[hibernate-dev] AbstractEntityManager

Woelke, Milan woelke at psitrans.de
Mon Nov 13 13:48:02 EST 2006


Hi, 
I was looking over the code of the ejb3 entitymanager (abstractentitymanager) and I was wondering about one thing:
Most of the methods defined by the entitymanager interface specification are implemented there with a try catch block protecting the whole method. In many cases the method throwPersistenceException(PersistenceException) is called either directly or indirectly, which then marks the transaction for rollback and rethrows the exception. My problem is that I don't think the rollback is correct here. IMHO the exception should be simply rethrown, for the bean provider to react to. If the bean provider chooses to not handle the exception the container provider should be the one marking the transaction for rollback. 

Am I getting something wrong or should this be fixed??

Regards, Milan Wölke






More information about the hibernate-dev mailing list