当前位置:网站首页>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 :
边栏推荐
- Pytorch基础
- 分布式節點免密登錄
- AcWing 242. A simple integer problem (tree array + difference)
- Codeforces Round #753 (Div. 3)
- Codeforces Round #771 (Div. 2)
- UDS learning notes on fault codes (0x19 and 0x14 services)
- When using lambda to pass parameters in a loop, the parameters are always the same value
- Rhcsa certification exam exercise (configured on the first host)
- express框架详解
- 【yarn】CDP集群 Yarn配置capacity调度器批量分配
猜你喜欢
How to configure flymcu (STM32 serial port download software) is shown in super detail
B tree and b+ tree of MySQL index implementation
Solve the problem of installing failed building wheel for pilot
Double to int precision loss
[CDH] cdh5.16 configuring the setting of yarn task centralized allocation does not take effect
[yarn] CDP cluster yarn configuration capacity scheduler batch allocation
MySQL主从复制的原理以及实现
vs2019 桌面程序快速入门
Linux yum安装MySQL
Vs2019 desktop app quick start
随机推荐
[蓝桥杯2017初赛]方格分割
{一周总结}带你走进js知识的海洋
2019 Tencent summer intern formal written examination
Pytorch基础
QT creator uses Valgrind code analysis tool
Software I2C based on Hal Library
error C4996: ‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_ s instead
wangeditor富文本引用、表格使用问题
PHP - whether the setting error displays -php xxx When PHP executes, there is no code exception prompt
About string immutability
[Blue Bridge Cup 2017 preliminary] grid division
【kerberos】深入理解kerberos票据生命周期
MySQL与c语言连接(vs2019版)
Face recognition_ recognition
How to build a new project for keil5mdk (with super detailed drawings)
Encodermappreduce notes
What does usart1 mean
[NPUCTF2020]ReadlezPHP
QT creator test
Case analysis of data inconsistency caused by Pt OSC table change