当前位置:网站首页>Mall project -- day09 -- order module
Mall project -- day09 -- order module
2022-07-06 11:48:00 【mb61037a3723f67】
One : Create a new order application and migrate to create a table :
1: New application orders:
2: Register subapplication , Configure the routing :
3: Create model classes :
4: Migration table creation :
Two : Create and save order to realize :
1: edit orders/views.py
Implementation view :
2: route :
3、 ... and : Concurrent order resource competition :
Four : Optimistic lock order :
1: Modify the isolation level of the database :
- (1)、 open mysql The configuration file :
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
- (2)、 Add configuration items at the end of the configuration file :
transaction-isolation=READ-COMMITTED
- Be careful : According to our analysis , The isolation level here can be set to
READ-COMMITTED
orREAD-UNCOMMITTED
Can achieve optimistic locking mechanism , But followMaximize isolation strength
principle , Let's set it toREAD-COMMITTED
Level ; - Higher isolation level , The more data security can be guaranteed ; The lower the isolation level , The more likely it is to produce wrong data ;
- No solution is absolutely superior or inferior , Only relatively appropriate ;
- Be careful : According to our analysis , The isolation level here can be set to
- (3)、 restart Mysql database :
sudo /etc/init.d/mysql restart
2: edit `apps/orders/views.py
5、 ... and : Settlement page :
1: edit apps/orders/views.py
Routing configuration :
边栏推荐
- Rhcsa certification exam exercise (configured on the first host)
- MongoDB
- 库函数--(持续更新)
- [CDH] cdh5.16 configuring the setting of yarn task centralized allocation does not take effect
- AcWing 179. Factorial decomposition problem solution
- About string immutability
- 分布式節點免密登錄
- 2019腾讯暑期实习生正式笔试
- [mrctf2020] dolls
- Vs2019 use wizard to generate an MFC Application
猜你喜欢
QT creator support platform
AcWing 242. A simple integer problem (tree array + difference)
Software I2C based on Hal Library
【yarn】Yarn container 日志清理
2019腾讯暑期实习生正式笔试
Word排版(小計)
How to build a new project for keil5mdk (with super detailed drawings)
AcWing 1298. Solution to Cao Chong's pig raising problem
Face recognition_ recognition
double转int精度丢失问题
随机推荐
保姆级出题教程
Wangeditor rich text reference and table usage
[AGC009D]Uninity
【yarn】Yarn container 日志清理
Stage 4 MySQL database
MySQL与c语言连接(vs2019版)
[蓝桥杯2017初赛]方格分割
AcWing 1298. Solution to Cao Chong's pig raising problem
Solve the problem of installing failed building wheel for pilot
About string immutability
Mysql的索引实现之B树和B+树
[Kerberos] deeply understand the Kerberos ticket life cycle
error C4996: ‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_ s instead
分布式节点免密登录
第4阶段 Mysql数据库
L2-007 family real estate (25 points)
Face recognition_ recognition
Why can't STM32 download the program
vs2019 第一个MFC应用程序
【yarn】CDP集群 Yarn配置capacity调度器批量分配