From: Thomas R. <tri...@us...> - 2009-03-19 14:50:51
|
Update of /cvsroot/springframework/spring/src/org/springframework/transaction/jta In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22109/src/org/springframework/transaction/jta Modified Files: WebSphereUowTransactionManager.java Log Message: WebSphereUowTransactionManager preserves original exception in case of rollback (SPR-5270 backport) Index: WebSphereUowTransactionManager.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/transaction/jta/WebSphereUowTransactionManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WebSphereUowTransactionManager.java 18 Dec 2007 15:18:40 -0000 1.4 --- WebSphereUowTransactionManager.java 19 Mar 2009 14:50:39 -0000 1.5 *************** *** 38,41 **** --- 38,42 ---- import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionSynchronizationManager; + import org.springframework.util.ReflectionUtils; /** *************** *** 289,292 **** --- 290,295 ---- private Object result; + private Throwable exception; + public UOWActionAdapter(TransactionDefinition definition, TransactionCallback callback, boolean actualTransaction, boolean newTransaction, boolean newSynchronization, boolean debug) { *************** *** 307,310 **** --- 310,316 ---- triggerBeforeCommit(status); } + catch (Throwable ex) { + this.exception = ex; + } finally { if (status.isLocalRollbackOnly()) { *************** *** 324,327 **** --- 330,336 ---- public Object getResult() { + if (this.exception != null) { + ReflectionUtils.rethrowRuntimeException(this.exception); + } return this.result; } |