Hi,
I need to know how can i acquire a read lock on a row through hibernate so that multiple instances can read the row but no one can update it or fail while acquiring a UPGRADE/UPGRADE_NOWAIT or any other kind data modification lock?
Right now we are doing something like getHibernateTemplate().get( SomeEntity.class, objId, LockMode.UPGRADE_NOWAIT ), but most of the time we are not updating the row, because of this lock mode other threads trying to acquire same sort of lock will fail resulting into cannot acquire lock exception.
Please post if you have any solution for this.
Thanks ankey
|