-->
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: p307 and p309 Is that a bug in the code. p299 not have
PostPosted: Sat Oct 23, 2004 12:17 pm 
Regular
Regular

Joined: Thu Sep 16, 2004 4:56 pm
Posts: 80
Comparing p299 to p307 and p309 source code examples, I notice if there is an exception from Adding new Bid to Item or anything, the transaction is rolled back as it should be(at least I think that is part of the intention....I do notice that any generic exception out of that code results in no transaction rollback. Is this ok?

Flipping to p299 or p307 though, this code was lost in the refactoring to create the HibernateUtil class. Now if there is some kind of exception...hibernate or not from looking up stuff in the db, etc. the transaction is not rolled back.

This seems like a major flaw in the explanation as it talks about hiding hibernate code. How do I do so for this rollback? Where would I put the rollback code. I do notice there is rollback code for when committing a transaction fails, but what happens with session.load fails...no rollback. Is it not needed? It was dropped with no explanation.

thanks for enlightening me here as I would really just like to know what the experts think a good pattern to this is,
dean


Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


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.