It is used to lock a record,if the record is locked then no body cant update the record till we released the lock. Once the transaction is committed then the lock will be released then they can update the record...
Student student = (Student)session.get(Student.class,"1");
session.lock(student,LockMode.UPGRADE);
LockMode.UPGRADE : an upgrade lock.objects loaded in this lock mode are materialized using an SQL select....for update.
Note : we do not use this locking technique in the projects.....
Student student = (Student)session.get(Student.class,"1");
session.lock(student,LockMode.UPGRADE);
LockMode.UPGRADE : an upgrade lock.objects loaded in this lock mode are materialized using an SQL select....for update.
Note : we do not use this locking technique in the projects.....