Home >Database >Mysql Tutorial >mysql事务用begin……commit好还是用set autocommit……commit好

mysql事务用begin……commit好还是用set autocommit……commit好

WBOY
WBOYOriginal
2016-06-06 09:32:452436browse

mysql事务数据库

我觉得第一种好,因为即使commit失败或者异常了,会自己超时释放锁住的表。第二种就悲剧了,commit失败,事务不会超时,表会一直被锁住。我理解的对吗

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn