
def a ActiveRecord::Base.transaction do # stuff endendActiveRecord::Base.transaction do a # more stuffend
如果内部事务成功但外部事务失败,反之亦然会发生什么?当成功或失败时会发生什么?
解决方法
transactioncalls can be nested. By default,this makes all database statements in the nested transaction block become part of the parent transaction.
该行为在documentation中有详细描述
总结以上是内存溢出为你收集整理的ruby-on-rails – 交易中的Rails交易?全部内容,希望文章能够帮你解决ruby-on-rails – 交易中的Rails交易?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)