-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate + SQLServer bug
PostPosted: Wed Jun 01, 2005 5:00 pm 
Beginner
Beginner

Joined: Tue Dec 21, 2004 11:53 am
Posts: 42
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.