dev@glassfish.java.net

Cause of RollbackException in transaction

From: Dragan Ljubojevic <ljufa_at_yahoo.com>
Date: Fri, 14 Dec 2007 03:52:58 -0800 (PST)

Why J2EETransaction.commit() implementation ignores cause of
RollbackException? And why javax.transaction.RollbackException does not define/implement
constructor RollbackException(String message, Throwable throwable);



Current implementation of commit method catches
RuntimeException, calls setRollbackOnly() and throws RollbackException with
string key only(without cause).




Will you break J2EE specification or lose some of
distribution transaction features if you expand RollbackException class with
new constructor and throw such constructed exception in commit() method?

If
not, can we expect such implementation in some of the future releases?




Cause exception (i.e. SQLException ) can be useful in
providing appropriate validation messages to web service clients. In this way
we can put some input data validation on database back.



Regards
Dragan







      ____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs