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:
|