What does Session.lock() method in hibernate do?
The SessionSession.lock() method is used to acquire a lock on an object in the current Session. This is useful for preventing concurrent updates to the same thing.