Author: youngm
Date: 2008-02-22 16:09:18 -0500 (Fri, 22 Feb 2008)
New Revision: 7469
Modified:
trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java
Log:
JBSEAM-2662
Modified: trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java
===================================================================
--- trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java 2008-02-22 15:48:20 UTC
(rev 7468)
+++ trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java 2008-02-22 21:09:18 UTC
(rev 7469)
@@ -25,6 +25,7 @@
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
+import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationAdapter;
import org.springframework.transaction.support.TransactionSynchronizationManager;
@@ -267,7 +268,7 @@
@Override
public void afterCompletion(int status)
{
- sync.afterCompletion(status);
+ sync.afterCompletion(convertSpringStatus(status));
}
@Override
@@ -275,5 +276,16 @@
{
sync.beforeCompletion();
}
+
+ private int convertSpringStatus(int springStatus) {
+ switch(springStatus) {
+ case TransactionSynchronization.STATUS_COMMITTED :
+ return Status.STATUS_COMMITTED;
+ case TransactionSynchronization.STATUS_ROLLED_BACK :
+ return Status.STATUS_ROLLEDBACK;
+ default :
+ return Status.STATUS_UNKNOWN;
+ }
+ }
}
}