Hi,
I am developing an application using Hibernate in combination with statless session beans. Whenever I persist data the code is executed withen a JTA transaction in the EJB container. As a result, any database or hibernate exceptions are thrown on committing the transaction.
The problem I am having is that if a database or hibernate exceptions are encounterd while committing the transaction a RollbackException is thrown. My code never gets the database or hibernate exceptions and only gets the RollbackException. The RollbackException does not provide any functions that gives me access to the originating exception. I can rollback the transaction but I can never now why.
The weblogic descriptor for entity beans has a flag called
delay-updates-until-end-of-tx
Setting this flag to FALSE will enable updates before the end of transaction. Therefore, if any integrity contraints exceptions are thrown I can detect them right away and know their source. I can choose to rollback the transaction too.
Does hibernate provide similar functionality?
Thanx
|