MYSQL DB SYN
来源:互联网 发布:algorithm基础算法 编辑:程序博客网 时间:2024/06/04 00:51
In mysql, you run these commands on your DB handle before runningy our queries the tables will auto lock :
begin work;
You then run your queries or have codeigniter run your various selects and updates using that db handle.
Then you either
commit;
or
rollback;
Any rows you select from will be locked and can't be read by other processes. If you specifically want the rows to still be readable,you can do:
Select ... IN SHARE MODE
From Mysql docs:
http://dev.mysql.com/doc/refman/5.5/en/select.html
If you use FOR UPDATE with a storage engine that uses page or rowlocks, rows examined by the query are write-locked until the end ofthe current transaction. Using LOCK IN SHARE MODE sets a sharedlock that permits other transactions to read the examined rows butnot to update or delete them. See Section 13.3.9.3, “SELECT ... FORUPDATE and SELECT ... LOCK IN SHARE MODE Locking Reads”.
Another person said this in comments already, but from the CIdocs:
$this->db->trans_start();$this->db->query('AN SQL QUERY...');$this->db->query('ANOTHER QUERY...');$this->db->query('AND YET ANOTHER QUERY...');$this->db->trans_complete();
trans_start and trans_complete will run those queries for you onyour handle...
there is probably a trans_rollback too...
- MYSQL DB SYN
- SYN
- mysql DB(学习笔记)
- mysql DB 远程访问
- C++ Wrapped Mysql DB
- db mysql error_list
- 一个DB类,MYSQL
- MySQL binlog-ignore-db
- [DB] Mysql learning notes!
- mysql DB C#封装
- DB-MySQL简介
- 2.DB-Mysql++实例
- 【DB】mysql 字段类型
- 【DB】mysql操作符
- DB理论--mysql基础
- mysql数据库 DB类
- mysql db 下载
- DB-Mysql-程序概述
- MYSQL to SQLite 脚本
- 不建议使用rowid作为sqlite主键
- CI 获取数据库数据类型总是为STRING 的解决方案
- CCLabelTTF with fixed width and dynamic height solution
- Erlang性能的八个误区(Efficiency Guide)
- MYSQL DB SYN
- NAT穿透
- Socket服务器整体架构概述
- uva10422(Knights in FEN)-bfs+哈希(隐式图搜索)
- MYSQL LIMIT NOT WORK WHEN ESTIMATE NUMBER OF ROWS
- CCSPRITE:Load image from users documents folder
- menuconfig 缺失 MTD partitioning support 解决办法
- ORDER BY RAND的一种比较好的方案][CI]
- Linux系统编程使用O_CREAT|O_CREATEXCL标志创建文件