mysql - MySQL 存储过程默认是事务性的吗?

标签 mysql stored-procedures transactions

我有一个读取和更新多个表的 MySQL 存储过程,所以我希望它是一个事务。默认情况下它已经是事务性的了吗?或者我需要做些什么吗?

MySQL 5.0+

最佳答案

我不这么认为。根据manual section on BEGIN...END statements :

Within all stored programs (stored procedures and functions, triggers, and events), the parser treats BEGIN [WORK] as the beginning of a BEGIN ... END block. Begin a transaction in this context with START TRANSACTION instead.

另请参阅 START TRANSACTION, COMMIT, and ROLLBACK Syntax 上的手册.

关于mysql - MySQL 存储过程默认是事务性的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6171933/

相关文章:

mysql - 将记录与所有可能的日期分组

c# - 处理 1 或 2 或 3 值的存储过程

django - django 1.6.1 中事务的奇怪行为

hibernate - Spring 和 hibernate : no session bound to the thread

android - beginTransaction()、endTransaction() 和 setTransactionSuccessful()。他们到底是做什么的?

python - 增加特定行的列中的整数值

mysql - Xampp无法在Win7上运行mysql

php - 表中的单引号中的双引号

mysql - 如何统计和比较同一张表中列的值

c# - 如何将枚举转换为字节数组?