-->
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: Recovering from a database deadlock exception
PostPosted: Fri Jan 04, 2008 5:23 pm 
Newbie

Joined: Fri Jan 04, 2008 2:42 pm
Posts: 1
Hi,
I am trying to saveOrUpdate an object using Hibernate 3.0 and I occasionally get database deadlock exceptions (from SQL Server 2005). The object has some one to many relationships with other classes and the saveOrUpdate cascades through these relationships. The related objects also have some one to many relationships.
What I want to do when the database exception occurs is to create a new session and try to save my object with that session. If I try to attach my object to the new session, I get a failure because some of the related objects have not been saved yet and have no ID.

Is the solution for me to traverse the object tree and exlicitly save all unsaved objects and then try to attach the parent object? Is there a simpler solution?

Any guidance would be appreciated.


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.