Hibernate version:
2.1.7
Name and version of the database you are using:
SqlServer 2000 with jTDS driver
Ok! I've posted before about a transaction question. I changed the way to do things. my update method:
public Serializable insert(Entity obj) throws PersistenceException {
Session session = getCurrentSession();
Serializable s = null;
try {
s = session.save(obj);
session.flush();
} catch (HibernateException e) {
logger.error(e);
throw new PersistenceException(e);
} finally {
closeSession();
}
return s;
}
Since my code runs inside a SLSB CTM enabled, I expected at the end of method execution, the transaction be commited. I really can't tell, since after leaving the method, the entire table is locked by sqlserver. I know this is a common issue with this thing (sorry, I can't call sqlServer a database) as it locks by page, not by row as Oracle.
My question is, when using this approach should the table be locked all the time? Isn't there a way to force the commit after the method was executed?
Thanks
|