当前位置:网站首页>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 :
边栏推荐
- MongoDB
- [mrctf2020] dolls
- 4. Install and deploy spark (spark on Yan mode)
- Detailed explanation of express framework
- 天梯赛练习集题解LV1(all)
- In the era of DFI dividends, can TGP become a new benchmark for future DFI?
- [NPUCTF2020]ReadlezPHP
- C语言读取BMP文件
- Why can't STM32 download the program
- 【CDH】CDH5.16 配置 yarn 任务集中分配设置不生效问题
猜你喜欢
Small L's test paper
wangeditor富文本引用、表格使用问题
Machine learning notes week02 convolutional neural network
Connexion sans mot de passe du noeud distribué
Learning question 1:127.0.0.1 refused our visit
【yarn】Yarn container 日志清理
分布式节点免密登录
【yarn】CDP集群 Yarn配置capacity调度器批量分配
QT creator support platform
Valentine's Day flirting with girls to force a small way, one can learn
随机推荐
Aborted connection 1055898 to db:
Encodermappreduce notes
Linux yum安装MySQL
L2-004 这是二叉搜索树吗? (25 分)
牛客Novice月赛40
Reading BMP file with C language
2019腾讯暑期实习生正式笔试
Julia 1.6 1.7 common problem solving
Rhcsa certification exam exercise (configured on the first host)
Those commonly used tool classes and methods in hutool
Codeforces Round #771 (Div. 2)
2020 WANGDING cup_ Rosefinch formation_ Web_ nmap
搞笑漫画:程序员的逻辑
ES6 let and const commands
What does usart1 mean
MATLAB学习和实战 随手记
nodejs 详解
【CDH】CDH/CDP 环境修改 cloudera manager默认端口7180
【presto】presto 参数配置优化
What does BSP mean