(at least in my production environment)
On any collection sharded by the shard key "_id", this code
2.0.0p247 :001 > i = Item.first
2.0.0p247 :002 > i.with_lock do
2.0.0p247 :003 > puts i.inspect
2.0.0p247 :004?> end
throws the exception "Mongoid::Locker::LockError: could not get lock"
from line 148 in lib/mongoid/locker.rb 'lock'
a collection sharded by some other key doesn't seem to have this problem, nor does an unsharded collection.
(at least in my production environment)
On any collection sharded by the shard key "_id", this code
throws the exception "Mongoid::Locker::LockError: could not get lock"
from line 148 in lib/mongoid/locker.rb 'lock'
a collection sharded by some other key doesn't seem to have this problem, nor does an unsharded collection.