如果我想通过python在数据库中启动事务,我必须显式地执行sql命令“BEGIN transaction”,如下所示:
import sqlite3
conn = sqlite3.connect(db)
c = conn.cursor()
c.execute('BEGIN TRANSACTION;')
##... some updates on the database ...
conn.commit() ## or c.execute('COMMIT'). Are these two expressions the same?
当我建立连接或开始事务时,数据库是否被锁定以便从其他客户端进行更改?
目前没有回答
相关问题 更多 >
编程相关推荐