[jboss-svn-commits] JBL Code SVN: r25420 - in labs/jbosstm/trunk/XTS/WSTX: classes10/com/arjuna/mwlabs/wst/at/local and 5 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Feb 25 07:44:29 EST 2009
Author: adinn
Date: 2009-02-25 07:44:29 -0500 (Wed, 25 Feb 2009)
New Revision: 25420
Added:
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubordinateTransactionImple.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubordinateTransactionImple.java
Modified:
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransaction.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransactionFactory.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/local/UserTransactionImple.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransaction.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransactionFactory.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommit.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitFailInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionRollback.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommit.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitFailInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionRollback.java
Log:
Remodelled API for creating subordinate AT transactions as per amended JBTM-491
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransaction.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransaction.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -77,6 +77,14 @@
}
/**
+ * get the user subordinate transaction
+ *
+ * this is a UserTransaction whose begin method will create an interposed AT transaction
+ */
+
+ public abstract UserTransaction getUserSubordinateTransaction();
+
+ /**
* Start a new transaction. If one is already associated with this thread
* then the WrongStateException will be thrown. Upon success, this
* operation associates the newly created transaction with the current
@@ -94,23 +102,6 @@
throws WrongStateException, SystemException;
/**
- * Start a new subordinate transaction. If an AT transaction is not currently associated with
- * this thread then the WrongStateException will be thrown. Upon success, this
- * operation associates the newly created subordinate transaction with the current
- * thread.
- */
- public abstract void beginSubordinate()
- throws WrongStateException, SystemException;
-
- /**
- * Start a new transaction with the specified timeout as its lifetime.
- * If an AT transaction is not currently associated with
- * this thread then the WrongStateException will be thrown.
- */
- public abstract void beginSubordinate(final int timeout)
- throws WrongStateException, SystemException;
-
- /**
* The transaction is committed by the commit method. This will execute
* the PhaseZero, 2PC and OutcomeNotification protocols prior to returning.
* If there is no transaction associated with the invoking thread then
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransactionFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransactionFactory.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransactionFactory.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -38,4 +38,9 @@
{
return UserTransaction.getUserTransaction() ;
}
+
+ public static UserTransaction userSubordinateTransaction ()
+ {
+ return UserTransaction.getUserTransaction().getUserSubordinateTransaction() ;
+ }
}
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/local/UserTransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/local/UserTransactionImple.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/local/UserTransactionImple.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -59,7 +59,12 @@
_contextManager.initialise(_factory);
}
- public void begin () throws WrongStateException, SystemException
+ public UserTransaction getUserSubordinateTransaction() {
+ // local does not currently implement subordinate transactions
+ return this;
+ }
+
+ public void begin () throws WrongStateException, SystemException
{
begin(0);
}
Added: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubordinateTransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubordinateTransactionImple.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubordinateTransactionImple.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -0,0 +1,60 @@
+package com.arjuna.mwlabs.wst.at.remote;
+
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.mwlabs.wst.at.context.TxContextImple;
+import com.arjuna.mw.wst.UserTransaction;
+
+/**
+ * Implementation of class used to create a subordinate AT transaction
+ *
+ * This class normally redirects calls to call the corresponding method of the singleton instance
+ * which implements UserTransaction. In the case of a begin call it redirects to a beginSubordinate call
+ * on the UserTransaction singleton. In the case of a commit or rollback it throws a WrongStateException,
+ * irrespective of whether the current transaction is top-level or subordinate since these operations
+ * should only be attempted via the UserTransactionImple singleton obtained by calling
+ * TransactionFactory.userTransaction()
+ */
+
+public class UserSubordinateTransactionImple extends UserTransaction
+{
+ public UserTransaction getUserSubordinateTransaction() {
+ return this;
+ }
+
+ public void begin() throws WrongStateException, SystemException {
+ ((UserTransactionImple)UserTransactionImple.getUserTransaction()).beginSubordinate(0);
+ }
+
+ /**
+ * Start a new subordinate transaction with the specified timeout as its lifetime.
+ * If an AT transaction is not currently associated with this thread then the
+ * WrongStateException will be thrown.
+ */
+ public void begin (int timeout) throws WrongStateException, SystemException
+ {
+ ((UserTransactionImple)UserTransactionImple.getUserTransaction()).beginSubordinate(timeout);
+ }
+
+ /**
+ * it is inappropriate to call this even if the current transaction is a top level AT
+ * transaction so we always throw a WrongStateException.
+ */
+ public void commit() throws TransactionRolledBackException, UnknownTransactionException, SecurityException, SystemException, WrongStateException {
+ throw new WrongStateException();
+ }
+
+ /**
+ * it is inappropriate to call this even if the current transaction is a top level AT
+ * transaction so we always throw a WrongStateException.
+ */
+ public void rollback() throws UnknownTransactionException, SecurityException, SystemException, WrongStateException {
+ throw new WrongStateException();
+ }
+
+ public String transactionIdentifier() {
+ return UserTransactionImple.getUserTransaction().transactionIdentifier();
+ }
+}
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -37,6 +37,7 @@
import com.arjuna.ats.arjuna.common.Uid;
import com.arjuna.mw.wst.TransactionManager;
import com.arjuna.mw.wst.UserTransaction;
+import com.arjuna.mw.wst.TxContext;
import com.arjuna.mw.wst.common.Environment;
import com.arjuna.mw.wstx.logging.wstxLogger;
import com.arjuna.mw.wsc.context.Context;
@@ -90,9 +91,14 @@
ex.printStackTrace();
}
+ _userSubordinateTransaction = new UserSubordinateTransactionImple();
}
- public void begin () throws WrongStateException, SystemException
+ public UserTransaction getUserSubordinateTransaction() {
+ return _userSubordinateTransaction;
+ }
+
+ public void begin () throws WrongStateException, SystemException
{
begin(0);
}
@@ -130,47 +136,6 @@
}
}
- public void beginSubordinate()
- throws WrongStateException, SystemException
- {
- beginSubordinate(0);
- }
-
- public void beginSubordinate(final int timeout)
- throws WrongStateException, SystemException
- {
- try
- {
- TxContextImple currentImple = (TxContextImple)_ctxManager.currentTransaction();
- if (currentImple == null || !(currentImple instanceof TxContextImple))
- throw new WrongStateException();
-
- com.arjuna.mw.wsc.context.Context ctx = startTransaction(timeout, currentImple);
-
- _ctxManager.resume(new TxContextImple(ctx));
- // n.b. we don't enlist the subordinate transaction for completion
- // that ensures that any attempt to commit or rollback will fail
- }
- catch (com.arjuna.wsc.InvalidCreateParametersException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (com.arjuna.wst.UnknownTransactionException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (SystemException ex)
- {
- tidyup();
-
- throw ex;
- }
- }
-
public void commit () throws TransactionRolledBackException,
UnknownTransactionException, SecurityException, SystemException, WrongStateException
{
@@ -225,6 +190,50 @@
return transactionIdentifier();
}
+ /**
+ * method provided for the benefit of UserSubordinateTransactionImple to allow it
+ * to begin a subordinate transaction which requires an existing context to be
+ * installed on the thread before it will start and instal la new transaction
+ *
+ * @param timeout
+ * @throws WrongStateException
+ * @throws SystemException
+ */
+ public void beginSubordinate(final int timeout)
+ throws WrongStateException, SystemException
+ {
+ try
+ {
+ TxContext current = _ctxManager.currentTransaction();
+ if (current == null || !(current instanceof TxContextImple))
+ throw new WrongStateException();
+ TxContextImple currentImple = (TxContextImple)current;
+ com.arjuna.mw.wsc.context.Context ctx = startTransaction(timeout, currentImple);
+
+ _ctxManager.resume(new TxContextImple(ctx));
+ // n.b. we don't enlist the subordinate transaction for completion
+ // that ensures that any attempt to commit or rollback will fail
+ }
+ catch (com.arjuna.wsc.InvalidCreateParametersException ex)
+ {
+ tidyup();
+
+ throw new SystemException(ex.toString());
+ }
+ catch (com.arjuna.wst.UnknownTransactionException ex)
+ {
+ tidyup();
+
+ throw new SystemException(ex.toString());
+ }
+ catch (SystemException ex)
+ {
+ tidyup();
+
+ throw ex;
+ }
+ }
+
/*
* Not sure if this is right as it doesn't map to registering a participant
* with the coordinator.
@@ -260,7 +269,7 @@
return context.getCoordinationContext();
}
- private final com.arjuna.mw.wsc.context.Context startTransaction(int timeout, TxContextImple current)
+ protected final com.arjuna.mw.wsc.context.Context startTransaction(int timeout, TxContextImple current)
throws com.arjuna.wsc.InvalidCreateParametersException,
SystemException
{
@@ -454,7 +463,7 @@
return participant ;
}
- private final void tidyup ()
+ protected final void tidyup ()
{
try
{
@@ -469,4 +478,5 @@
protected ContextManager _ctxManager = new ContextManager();
protected String _activationCoordinatorService;
private Hashtable _completionCoordinators = new Hashtable();
+ private UserSubordinateTransactionImple _userSubordinateTransaction;
}
Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransaction.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransaction.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -77,6 +77,14 @@
}
/**
+ * get the user subordinate transaction
+ *
+ * this is a UserTransaction whose begin method will create an interposed AT transaction
+ */
+
+ public abstract UserTransaction getUserSubordinateTransaction();
+
+ /**
* Start a new transaction. If one is already associated with this thread
* then the WrongStateException will be thrown. Upon success, this
* operation associates the newly created transaction with the current
@@ -94,23 +102,6 @@
throws WrongStateException, SystemException;
/**
- * Start a new subordinate transaction. If an AT transaction is not currently associated with
- * this thread then the WrongStateException will be thrown. Upon success, this
- * operation associates the newly created subordinate transaction with the current
- * thread.
- */
- public abstract void beginSubordinate()
- throws WrongStateException, SystemException;
-
- /**
- * Start a new transaction with the specified timeout as its lifetime.
- * If an AT transaction is not currently associated with
- * this thread then the WrongStateException will be thrown.
- */
- public abstract void beginSubordinate(final int timeout)
- throws WrongStateException, SystemException;
-
- /**
* The transaction is committed by the commit method. This will execute
* the PhaseZero, 2PC and OutcomeNotification protocols prior to returning.
* If there is no transaction associated with the invoking thread then
Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransactionFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransactionFactory.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransactionFactory.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -38,4 +38,9 @@
{
return UserTransaction.getUserTransaction() ;
}
+
+ public static UserTransaction userSubordinateTransaction ()
+ {
+ return UserTransaction.getUserTransaction().getUserSubordinateTransaction() ;
+ }
}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubordinateTransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubordinateTransactionImple.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubordinateTransactionImple.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -0,0 +1,62 @@
+package com.arjuna.mwlabs.wst11.at.remote;
+
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wsc11.context.Context;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mwlabs.wst11.at.context.TxContextImple;
+
+/**
+ * Implementation of class used to create a subordinate AT transaction
+ *
+ * This class normally redirects all calls to call the corresponding method of the singleton instance
+ * which implements UserTransaction. In the case of a begin call it redirects to a beginSubordinate call
+ * on the UserTransaction singleton. In the case of a commit or rollback it throws a WrongStateException,
+ * irrespective of whether the current transaction is top-level or subordinate since these operations
+ * should only be attempted via the UserTransactionImple singleton obtained by calling
+ * TransactionFactory.userTransaction()
+ */
+
+public class UserSubordinateTransactionImple extends UserTransaction
+{
+ public UserTransaction getUserSubordinateTransaction() {
+ return this;
+ }
+
+ public void begin() throws WrongStateException, SystemException {
+ ((UserTransactionImple)UserTransactionImple.getUserTransaction()).beginSubordinate(0);
+ }
+
+ /**
+ * Start a new subordinate transaction with the specified timeout as its lifetime.
+ * If an AT transaction is not currently associated with this thread then the
+ * WrongStateException will be thrown.
+ */
+ public void begin (int timeout) throws WrongStateException, SystemException
+ {
+ ((UserTransactionImple)UserTransactionImple.getUserTransaction()).beginSubordinate(timeout);
+ }
+
+ /**
+ * it is inappropriate to call this even if the current transaction is a top level AT
+ * transaction so we always throw a WrongStateException.
+ */
+ public void commit() throws TransactionRolledBackException, UnknownTransactionException, SecurityException, SystemException, WrongStateException {
+ throw new WrongStateException();
+ }
+
+ /**
+ * it is inappropriate to call this even if the current transaction is a top level AT
+ * transaction so we always throw a WrongStateException.
+ */
+ public void rollback() throws UnknownTransactionException, SecurityException, SystemException, WrongStateException {
+ throw new WrongStateException();
+ }
+
+ public String transactionIdentifier() {
+ return UserTransactionImple.getUserTransaction().transactionIdentifier();
+ }
+}
Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -63,9 +63,14 @@
ex.printStackTrace();
}
+ _userSubordinateTransaction = new UserSubordinateTransactionImple();
}
- public void begin () throws WrongStateException, SystemException
+ public UserTransaction getUserSubordinateTransaction() {
+ return _userSubordinateTransaction;
+ }
+
+ public void begin () throws WrongStateException, SystemException
{
begin(0);
}
@@ -103,46 +108,6 @@
}
}
- public void beginSubordinate () throws WrongStateException, SystemException
- {
- beginSubordinate(0);
- }
-
- public void beginSubordinate (int timeout) throws WrongStateException, SystemException
- {
- try
- {
- TxContext current = _ctxManager.currentTransaction();
- if ((current == null) || !(current instanceof TxContextImple))
- throw new WrongStateException();
-
- TxContextImple currentImple = (TxContextImple) current;
- Context ctx = startTransaction(timeout, currentImple);
-
- _ctxManager.resume(new TxContextImple(ctx));
- // n.b. we don't enlist the subordinate transaction for completion
- // that ensures that any attempt to commit or rollback will fail
- }
- catch (com.arjuna.wsc.InvalidCreateParametersException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (com.arjuna.wst.UnknownTransactionException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (SystemException ex)
- {
- tidyup();
-
- throw ex;
- }
- }
-
public void commit () throws TransactionRolledBackException,
UnknownTransactionException, SecurityException, SystemException, WrongStateException
{
@@ -197,6 +162,50 @@
return transactionIdentifier();
}
+ /**
+ * method provided for the benefit of UserSubordinateTransactionImple to allow it
+ * to begin a subordinate transaction which requires an existing context to be
+ * installed on the thread before it will start and instal la new transaction
+ *
+ * @param timeout
+ * @throws WrongStateException
+ * @throws SystemException
+ */
+ public void beginSubordinate(int timeout) throws WrongStateException, SystemException
+ {
+ try
+ {
+ TxContext current = _ctxManager.currentTransaction();
+ if ((current == null) || !(current instanceof TxContextImple))
+ throw new WrongStateException();
+
+ TxContextImple currentImple = (TxContextImple) current;
+ Context ctx = startTransaction(timeout, currentImple);
+
+ _ctxManager.resume(new TxContextImple(ctx));
+ // n.b. we don't enlist the subordinate transaction for completion
+ // that ensures that any attempt to commit or rollback will fail
+ }
+ catch (com.arjuna.wsc.InvalidCreateParametersException ex)
+ {
+ tidyup();
+
+ throw new SystemException(ex.toString());
+ }
+ catch (com.arjuna.wst.UnknownTransactionException ex)
+ {
+ tidyup();
+
+ throw new SystemException(ex.toString());
+ }
+ catch (SystemException ex)
+ {
+ tidyup();
+
+ throw ex;
+ }
+ }
+
/*
* Not sure if this is right as it doesn't map to registering a participant
* with the coordinator.
@@ -252,7 +261,7 @@
return contextImple.getCoordinationContext();
}
- private final Context startTransaction(int timeout, TxContextImple current)
+ protected final Context startTransaction(int timeout, TxContextImple current)
throws com.arjuna.wsc.InvalidCreateParametersException,
SystemException
{
@@ -456,7 +465,7 @@
return builder.build();
}
- private final void tidyup ()
+ protected final void tidyup ()
{
try
{
@@ -471,4 +480,5 @@
protected ContextManager _ctxManager = new ContextManager();
protected String _activationCoordinatorService;
private Hashtable _completionCoordinators = new Hashtable();
+ private UserSubordinateTransactionImple _userSubordinateTransaction;
}
Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommit.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommit.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommit.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -25,6 +25,7 @@
import com.arjuna.mw.wst.TransactionManager;
import com.arjuna.mw.wst.UserTransaction;
import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst.UserTransactionFactory;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
import junit.framework.TestCase;
@@ -40,7 +41,8 @@
public static void testSubTransactionCommit()
throws Exception
{
- final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -53,7 +55,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ut.beginSubordinate();
+ ust.begin();
final TxContext stx = tm.suspend();
tm.resume(stx);
tm.enlistForDurableTwoPhase(p3, p3.identifier());
Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitFailInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitFailInPrepare.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitFailInPrepare.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -24,6 +24,7 @@
import com.arjuna.mw.wst.TransactionManager;
import com.arjuna.mw.wst.UserTransaction;
import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst.UserTransactionFactory;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
import com.arjuna.wst.tests.FailureParticipant;
@@ -41,7 +42,8 @@
public static void testSubTransactionCommitFailInPrepare()
throws Exception
{
- final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -54,7 +56,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ut.beginSubordinate();
+ ust.begin();
final TxContext stx = tm.suspend();
tm.resume(stx);
tm.enlistForDurableTwoPhase(p3, "failure in prepare");
Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -24,6 +24,7 @@
import com.arjuna.mw.wst.TransactionManager;
import com.arjuna.mw.wst.UserTransaction;
import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst.UserTransactionFactory;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
import com.arjuna.wst.tests.FailureParticipant;
@@ -41,7 +42,8 @@
public static void testSubTransactionCommitRollbackInPrepare()
throws Exception
{
- final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -54,7 +56,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ut.beginSubordinate();
+ ust.begin();
final TxContext stx = tm.suspend();
tm.resume(stx);
tm.enlistForDurableTwoPhase(p3, "failure in prepare");
Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionRollback.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionRollback.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionRollback.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -24,6 +24,7 @@
import com.arjuna.mw.wst.TransactionManager;
import com.arjuna.mw.wst.UserTransaction;
import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst.UserTransactionFactory;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
import junit.framework.TestCase;
@@ -39,7 +40,8 @@
public static void testSubTransactionRollback()
throws Exception
{
- final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -52,7 +54,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ut.beginSubordinate();
+ ust.begin();
final TxContext stx = tm.suspend();
tm.resume(stx);
tm.enlistForDurableTwoPhase(p3, p3.identifier());
Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommit.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommit.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommit.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -23,6 +23,7 @@
import com.arjuna.mw.wst11.TransactionManager;
import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserTransactionFactory;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -39,7 +40,8 @@
public static void testSubTransactionCommit()
throws Exception
{
- final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -52,7 +54,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ut.beginSubordinate();
+ ust.begin();
final TxContext stx = tm.suspend();
tm.resume(stx);
tm.enlistForDurableTwoPhase(p3, p3.identifier());
Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitFailInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitFailInPrepare.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitFailInPrepare.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -23,6 +23,7 @@
import com.arjuna.mw.wst11.TransactionManager;
import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserTransactionFactory;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -42,7 +43,8 @@
public static void testSubTransactionCommitFailInPrepare()
throws Exception
{
- final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -55,7 +57,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ut.beginSubordinate();
+ ust.begin();
final TxContext stx = tm.suspend();
tm.resume(stx);
tm.enlistForDurableTwoPhase(p3, "failure in prepare");
Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -23,6 +23,7 @@
import com.arjuna.mw.wst11.TransactionManager;
import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserTransactionFactory;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -41,7 +42,8 @@
public static void testSubTransactionCommitRollbackInPrepare()
throws Exception
{
- final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -54,7 +56,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ut.beginSubordinate();
+ ust.begin();
final TxContext stx = tm.suspend();
tm.resume(stx);
tm.enlistForDurableTwoPhase(p3, "failure in prepare");
Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionRollback.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionRollback.java 2009-02-25 09:45:03 UTC (rev 25419)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionRollback.java 2009-02-25 12:44:29 UTC (rev 25420)
@@ -23,6 +23,7 @@
import com.arjuna.mw.wst11.TransactionManager;
import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserTransactionFactory;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -39,7 +40,8 @@
public static void testSubTransactionRollback()
throws Exception
{
- final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -52,7 +54,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ut.beginSubordinate();
+ ust.begin();
final TxContext stx = tm.suspend();
tm.resume(stx);
tm.enlistForDurableTwoPhase(p3, p3.identifier());
More information about the jboss-svn-commits
mailing list