-->
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.  [ 4 posts ] 
Author Message
 Post subject: MSSQL 2000 and hibernate: Deadlocks with more than 20 thread
PostPosted: Thu May 05, 2005 1:12 pm 
Newbie

Joined: Thu May 05, 2005 12:52 pm
Posts: 2
Is there a problem with MSSQL 2000 and hibernate with 20 or more threads.

I am currently openning a session calling update and later closing the session . This activity i do it for 20 threads. The application throws a deadlock error.

Hibernate version is 2.1.4

In the Hibernate bug database, there was a patch provided which will resolve deadlocks happening in the DB w.r.t MSSQL. The patch is now part of hibernate3.jar file.

Does that patch work and if i use the code similarly as provided in LockingTest.java file, will it resolve the deadlock problem.

If anyone needs the hbm.xml and HibernateImpl. I would put the code on the forum.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 1:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
talk to MS SQL 2000 about their product and how you avoid deadlocks at the db level.

ms sql 2000 normally locks much more than you actually touch so it becomes increasingly important to manage your access path/sequence to the database when you have more and more threads.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Any more help would be really appreciated
PostPosted: Fri May 06, 2005 6:08 am 
Newbie

Joined: Thu May 05, 2005 12:52 pm
Posts: 2
Quote:
to manage your access path/sequence to the database


Do you feel the MSSQL server needs to be tweaked a little in order to make this scenario work with 20 threads ?

I would really appreciate as we have a mjor release in few weeks and i need to resolve this issue ASAP ?

If i send the code , can you suggest a different way to write in order to avoid this deadlock?

The code is working fine in MySQL and does not give any errors.

I am currently using spring 1.1.1 and hibernate 2.1.4 to execute the application. But i am not using the HibernateTemplate given by the Spring but using sessionFactory.openSession() to open session

the calling session.update() /session.delete() on the VO , flush the session and later close the session

Do you suggest using refresh on each VO before i call find/update/delete ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 06, 2005 6:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
You need to go look at why the deadlocks occur and then see if you can avoid it by performing updates/reads in a different sequence.
Btw. why dont you use Hibernate 2.1.8 ?

I would suggest you looked at http://www.hibernate.org/148.html since tracking down such issues takes more time than I have freely available ;)

_________________
Max
Don't forget to rate


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.