Please help me in understanding the usage of session lock.
Hibernate session is re-associated to the detached object using AOP interceptor which will perform the below logic
session.buildLockRequest(LockOptions.NONE).lock(object);
Is there is any advantage of using this interceptor in method which call the session.save/update?
Will the optimistic locking ignored when the session lock is used?
depends on what object is. This will basicly tell the session that object is a unmodified persistent entity which should now be associated to the session the same way as objects loaded through the session.