-->
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: CMT/JTA and Hibernate Exceptions
PostPosted: Wed Feb 23, 2005 12:03 pm 
Beginner
Beginner

Joined: Wed Feb 23, 2005 11:32 am
Posts: 25
Location: Austria/Vienna
We are using hibernate (currently 2.1.7 with CMT and WebSphere AS 5.1.x

We are not happy with the following statement within the 2. and 3.0 documentation:

11.2.3. Exception handling:
"No exception thrown by Hibernate can be treaded as recoverable."

Problem:

1.) more then one hibernate inserts and updates will be done during business functions within CMT-EJB calls.
2.) one insert or update will throw a SQL-Exception with duplicate key or optimistic locking reasons.

this is not an un-recoverable error for the business logic, because in some cases it should simply retry the update statements with some modified values, and it should still commit the business transaction including all other inserts and updates within the business-method.

Possible solutions:

a.) We could solve this by ending the cmt-transacion, which would rollback everything, and restart the whole CMT-transaction, re-executing the all inserts and updates. but we do not like this approach, because we would not do it this way with a plain jdbc-implementation.

b.) we could increase the db-locking to avoid some of the above conditions, but we do not like this approach either.

Without hibernate, these exceptions would be recoverable ?

thanks!


Top
 Profile  
 
 Post subject: info
PostPosted: Mon Feb 28, 2005 10:47 am 
Beginner
Beginner

Joined: Wed Feb 23, 2005 11:32 am
Posts: 25
Location: Austria/Vienna
what we have done so far is this:

although we are working within a JTA Transaction we have tried to use multiple sessions.

this means we have closed the session just before executing the critital to be recovered sql statement, and closed it immediately again if any exception occours which should be recovered.

this seems to work, but we are not sure, if we are officialy allowed to do so.
furthermore we loose all caching effects for this JTA session.

can any hibernate team member please give us an official statement for this problem an how it should be handled propperly.

thanks.


Top
 Profile  
 
 Post subject: is there anyone who can give us some official statement ?
PostPosted: Thu Mar 10, 2005 9:43 am 
Beginner
Beginner

Joined: Wed Feb 23, 2005 11:32 am
Posts: 25
Location: Austria/Vienna
is there anyone who can give us some official statement ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 2:41 pm 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Perhaps you should consider the complexity of rolling back 'object state'.


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