当前位置:网站首页>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-COMMITTEDorREAD-UNCOMMITTEDCan achieve optimistic locking mechanism , But followMaximize isolation strengthprinciple , Let's set it toREAD-COMMITTEDLevel ; - 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 :
边栏推荐
- [MRCTF2020]套娃
- QT creator runs the Valgrind tool on external applications
- encoderMapReduce 随手记
- 2020 WANGDING cup_ Rosefinch formation_ Web_ nmap
- wangeditor富文本引用、表格使用问题
- [蓝桥杯2021初赛] 砝码称重
- Common regular expression collation
- 天梯赛练习集题解LV1(all)
- In the era of DFI dividends, can TGP become a new benchmark for future DFI?
- TypeScript
猜你喜欢

vs2019 第一个MFC应用程序

Cookie setting three-day secret free login (run tutorial)

error C4996: ‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_s instead

MongoDB

Word排版(小計)

分布式节点免密登录

AI benchmark V5 ranking

分布式事务的实现方案

2019腾讯暑期实习生正式笔试

Case analysis of data inconsistency caused by Pt OSC table change
随机推荐
Using LinkedHashMap to realize the caching of an LRU algorithm
UDS learning notes on fault codes (0x19 and 0x14 services)
PHP - whether the setting error displays -php xxx When PHP executes, there is no code exception prompt
Codeforces Round #771 (Div. 2)
Composition des mots (sous - total)
nodejs 详解
[BSidesCF_2020]Had_ a_ bad_ day
[AGC009D]Uninity
What does BSP mean
[Kerberos] deeply understand the Kerberos ticket life cycle
【flink】flink学习
Stage 4 MySQL database
机器学习笔记-Week02-卷积神经网络
Common regular expression collation
【yarn】Yarn container 日志清理
常用正则表达式整理
Reading BMP file with C language
Machine learning -- census data analysis
库函数--(持续更新)
保姆级出题教程