新手问题 rails 的锁机制是怎样的

jasonliu · February 14, 2014 · Last by lang1pal replied at February 17, 2014 · 3283 hits

Rails 如何锁住 mysql 表的一条记录,rails 的锁机制是怎样的

  1. 乐观锁,数据表加上 lock_version 字段,就自动开启
  2. 悲观锁,例如Product.find(:first, lock: true)
You need to Sign in before reply, if you don't have an account, please Sign up first.