多个 Delayed_Job Worker 写入同一个表 (Rails 3)
有没有办法让多个delayed_job工作人员更新到同一个表?我有一个使用 Ruby 1.9.2 的 Rails 3.09 应用程序。我需要运行多个查询,但我不想按顺序运行它们,因为查询结果不相互依赖。但是,结果确实会写入同一个表,但不会写入同一行。 Thinking_Sphinx 也参与其中,因为它更新表。是否可以将delayed_job配置为不锁定全表并允许对同一个表进行多次更新?
Is there a way to have multiple delayed_job workers updating to the same table? I have a Rails 3.09 application using Ruby 1.9.2. I need to run several queries and I want to not have to run them so sequentially since the query results do not rely on each other. However, the results do get written to the same table but not the same row. Thinking_Sphinx is also involved because it updates the table. Can delayed_job be configured to not lock the full table and allow multiple updates to the same table?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这和DelayedJob没有任何关系。这不是导致表锁的原因。如果您使用 MyISAM,那么这是存储引擎的限制,您应该考虑使用 InnoDB。如果您已经使用 Inno,则需要调查导致全表锁定的原因。
This doesn't have anything to do with DelayedJob. It's not what's causing table locks. If you're using MyISAM then this is a limitation of your storage engine and you should look at InnoDB instead. If you're on Inno already, you'll need to investigate what's causing the full table lock.