Joined: Mon Feb 23, 2009 10:59 am Posts: 1 Location: Managua,Nicaragua
|
i'm trying to use row lock on ass400 tables and i'm using a datasource that is on IBM WAS 6.1 to connect to the iseries.
what i want to do is to lock the row (select for update) and keep it locked while i'm editing the row.
This is the code i'm using to select the row
------------------------------------------------
Session session = HibernateUtil.getSessionFactoryENS().getCurrentSession();
Transaction tx = null;
Aplicacion aplicacion = null;
tx = session.getTransaction();
if(tx == null || !tx.isActive()){
tx = session.beginTransaction();
}
aplicacion = (Aplicacion) session.get(Aplicacion.class, sCodApp, LockMode.UPGRADE);
------------------------------------------------------------
but whenever i open another transaction the lock is released and the operation is rolled back.
so, if another user tries to edit the same row at this point, the row won't be locked.
So is there any way to keep the transaction open until i call the update method.
Any help is more than welcome.
|
|