教义 NestedSet 引发锁等待超时?
我使用 Doctrine NestedSet 行为有一段时间了,没有任何 问题,但我今天在使用 createRoot() 时遇到了一个新问题 或 save() 之后的其他行为方法; 做类似的事情:
$myObject()->save();
$myTree = Doctrine::getTable('myClass')->getTree();
$myTree->createRoot($myObject);
给了我这个例外:
Doctrine_Connection_Mysql_Exception
SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction
我不确定这是一个 Doctrine bug,但来自我的数据库的东西 (MySQL)因为 Doctrine 代码在我的服务器上没有改变。 看起来 save() 操作锁定了表和更新查询 从 createRoot 失败。 请注意,相关表非常小(25 行),而且所有内容 最近工作顺利... 有什么建议吗?
I'm using Doctrine NestedSet behavior for a while now without any
problem but I'm just facing a new issue today while using createRoot()
or other behavior methods after a save();
Doing something like :
$myObject()->save();
$myTree = Doctrine::getTable('myClass')->getTree();
$myTree->createRoot($myObject);
gives me that exception :
Doctrine_Connection_Mysql_Exception
SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction
I'm not sure it's a Doctrine bug but something coming from my db
(MySQL) because Doctrine code hasn't change on my server.
Looks like the save() operation locks the table and the update query
from the createRoot fails.
Note that the related table is pretty small (25 lines) and everything
was working well recently...
Any suggestions ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,但我找到了。
该错误是由对我的代码进行的轻微修改引起的,该修改在开发环境和生产环境之间的行为有所不同。这段代码与 Doctrine_Query 相关,我重写它来处理主/从连接。某种愚蠢的效果面,非常难以调试。
谢谢你的帮助。
Nope, but I found it.
The bug was caused by a slight modification on my code which was acting differently between dev and prod environment. This piece of code is related to Doctrine_Query which I override to handle master/slave connections. Some kind of dumb effect side, very difficult to debug.
Thank you for help.