当前位置:网站首页>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 :
边栏推荐
猜你喜欢
Request object and response object analysis
Learning question 1:127.0.0.1 refused our visit
[yarn] CDP cluster yarn configuration capacity scheduler batch allocation
Connexion sans mot de passe du noeud distribué
第4阶段 Mysql数据库
小L的试卷
Linux yum安装MySQL
QT creator test
[Blue Bridge Cup 2017 preliminary] grid division
Pytorch基础
随机推荐
[BSidesCF_2020]Had_a_bad_day
[Flink] Flink learning
Pytoch Foundation
STM32型号与Contex m对应关系
[蓝桥杯2017初赛]包子凑数
Codeforces Round #753 (Div. 3)
【CDH】CDH/CDP 环境修改 cloudera manager默认端口7180
[Blue Bridge Cup 2017 preliminary] grid division
TypeScript
2020 WANGDING cup_ Rosefinch formation_ Web_ nmap
人脸识别 face_recognition
AI benchmark V5 ranking
Software I2C based on Hal Library
2019腾讯暑期实习生正式笔试
Funny cartoon: Programmer's logic
Nanny level problem setting tutorial
ES6 Promise 对象
Kept VRRP script, preemptive delay, VIP unicast details
[CDH] cdh5.16 configuring the setting of yarn task centralized allocation does not take effect
Some concepts often asked in database interview