[jboss-svn-commits] JBL Code SVN: r25343 - in labs/jbosstm/trunk/XTS/WSTX: classes10/com/arjuna/mw/wst/deploy and 8 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Feb 19 08:31:33 EST 2009
Author: adinn
Date: 2009-02-19 08:31:32 -0500 (Thu, 19 Feb 2009)
New Revision: 25343
Removed:
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubtransaction.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubtransactionImple.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubtransaction.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubtransactionImple.java
Modified:
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransaction.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.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/deploy/WSTXInitialisation.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java
labs/jbosstm/trunk/XTS/WSTX/config/wst.xml
labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml
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:
fixes for JBTM-491
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubtransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubtransaction.java 2009-02-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubtransaction.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2008,
- * @author JBoss Inc.
- */
-
-package com.arjuna.mw.wst;
-
-/**
- * This is the interface that allows transactions to be started and terminated.
- * The messaging layer converts the Commit, Rollback and Notify messages into
- * calls on this.
- * Importantly, a UserTransaction does not represent a specific transaction,
- * but rather is responsible for providing access to an implicit per-thread
- * transaction context; it is similar to the UserTransaction in the JTA
- * specification. Therefore, all of the UserTransaction methods implicitly act
- * on the current thread of control.
- *
- * @author Andrew Dinn
- * @version $Id:$
- */
-
-public abstract class UserSubtransaction extends UserTransaction
-{
- /**
- * The transaction.
- */
- private static UserTransaction USER_TRANSACTION ;
-
- /**
- * Get the user transaction.
- * @return the user transaction.
- */
- public static synchronized UserTransaction getUserTransaction()
- {
- return USER_TRANSACTION ;
- }
-
- /**
- * Set the user transaction.
- * @param userTransaction The user transaction.
- */
- public static synchronized void setUserTransaction(final UserTransaction userTransaction)
- {
- USER_TRANSACTION = userTransaction ;
- }
-}
\ No newline at end of file
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransaction.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -94,6 +94,23 @@
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/deploy/WSTXInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java 2009-02-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -126,17 +126,15 @@
final Element docElem = doc.getDocumentElement() ;
final String userTx = getService(docElem, "UserTransaction") ;
- final String userSubTx = getService(docElem, "UserSubtransaction") ;
final String txManager = getService(docElem, "TransactionManager") ;
final String userBa = getService(docElem, "UserBusinessActivity") ;
final String baManager = getService(docElem, "BusinessActivityManager") ;
- if ((userTx == null) || (userSubTx == null) || (txManager == null) || (userBa == null) || (baManager == null))
+ if ((userTx == null) || (txManager == null) || (userBa == null) || (baManager == null))
{
throw new FileNotFoundException(wstxLogger.log_mesg.getString("com.arjuna.mw.wst.deploy.WSTXI_23"));
}
UserTransaction.setUserTransaction((UserTransaction)ClassLoaderHelper.forName(getClass(), userTx).newInstance()) ;
- UserSubtransaction.setUserTransaction((UserTransaction)ClassLoaderHelper.forName(getClass(), userSubTx).newInstance()) ;
TransactionManager.setTransactionManager((TransactionManager)ClassLoaderHelper.forName(getClass(), txManager).newInstance()) ;
UserBusinessActivity.setUserBusinessActivity((UserBusinessActivity)ClassLoaderHelper.forName(getClass(), userBa).newInstance()) ;
BusinessActivityManager.setBusinessActivityManager((BusinessActivityManager)ClassLoaderHelper.forName(getClass(), baManager).newInstance()) ;
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/local/UserTransactionImple.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -98,6 +98,18 @@
*/
}
+ public void beginSubordinate()
+ throws WrongStateException, SystemException
+ {
+ beginSubordinate(0);
+ }
+
+ public void beginSubordinate(final int timeout)
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException("com.arjuna.mwlabs.wst.at.local.UserTransactionImple : beginSubordinate not implemented");
+ }
+
public void commit () throws TransactionRolledBackException,
UnknownTransactionException, SystemException
{
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubtransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubtransactionImple.java 2009-02-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubtransactionImple.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -1,164 +0,0 @@
-package com.arjuna.mwlabs.wst.at.remote;
-
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mw.wsc.context.Context;
-import com.arjuna.mwlabs.wst.at.ContextImple;
-import com.arjuna.mwlabs.wst.at.context.TxContextImple;
-import com.arjuna.webservices.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-import com.arjuna.wsc.ActivationCoordinator;
-import com.arjuna.wsc.InvalidCreateParametersException;
-import com.arjuna.wsc.messaging.MessageId;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-
-/**
- * @message com.arjuna.mwlabs.wst.at.remote.UserSubTransactionImple_1
- * [com.arjuna.mwlabs.wst.at.remote.UserSubTransactionImple_1] - Received
- * context is null!
- */
-public class UserSubtransactionImple extends UserTransactionImple
-{
-
- public UserSubtransactionImple()
- {
- super();
- }
-
- public void begin () throws WrongStateException, SystemException
- {
- begin(0);
- }
-
- public void begin (int timeout) throws WrongStateException, SystemException
- {
- try
- {
- if (_ctxManager.currentTransaction() == null)
- throw new WrongStateException();
-
- Context ctx = startTransaction(timeout);
-
- _ctxManager.resume(new TxContextImple(ctx));
- }
- catch (InvalidCreateParametersException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (UnknownTransactionException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (SystemException ex)
- {
- tidyup();
-
- throw ex;
- }
- }
-
- public void commit () throws TransactionRolledBackException,
- UnknownTransactionException, SecurityException, SystemException, WrongStateException
- {
- tidyup();
- throw new WrongStateException();
- }
-
- public void rollback () throws UnknownTransactionException, SecurityException, SystemException, WrongStateException
- {
- tidyup();
- throw new WrongStateException();
- }
-
- public String transactionIdentifier ()
- {
- try
- {
- return _ctxManager.currentTransaction().toString();
- }
- catch (SystemException ex)
- {
- return "Unknown";
- }
- catch (NullPointerException ex)
- {
- return "Unknown";
- }
- }
-
- public String toString ()
- {
- return transactionIdentifier();
- }
-
- /*
- * Not sure if this is right as it doesn't map to registering a participant
- * with the coordinator.
- */
-
- private final Context startTransaction(int timeout)
- throws InvalidCreateParametersException,
- SystemException
- {
- try
- {
- // TODO: tricks for per app _activationCoordinatorService config, perhaps:
- //InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/foo.properties");
-
-
-
- final CoordinationContextType current = currentCoordinationContext();
- final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
- final String messageId = MessageId.getMessageId() ;
- final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
- _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, current) ;
- if (coordinationContext == null)
- {
- throw new SystemException(
- wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.remote.UserSubTransactionImple_1"));
- }
- return new ContextImple(coordinationContext) ;
- }
- catch (final InvalidCreateParametersException icpe)
- {
- throw icpe ;
- }
- catch (final SoapFault sf)
- {
- throw new SystemException(sf.getMessage()) ;
- }
- catch (final Exception ex)
- {
- throw new SystemException(ex.toString());
- }
- }
-
- /**
- * get a CoordinationContext based on the one stasahed away in the current TxContext
- */
- public CoordinationContextType currentCoordinationContext() throws SystemException
- {
- final TxContextImple txContext = (TxContextImple)_ctxManager.currentTransaction();
- final CoordinationContextType current = txContext.context().getCoordinationContext();
- return current;
- }
-
- private final void tidyup ()
- {
- try
- {
- _ctxManager.suspend();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-}
\ No newline at end of file
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -39,6 +39,7 @@
import com.arjuna.mw.wst.UserTransaction;
import com.arjuna.mw.wst.common.Environment;
import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mw.wsc.context.Context;
import com.arjuna.mwlabs.wst.at.ContextImple;
import com.arjuna.mwlabs.wst.at.context.TxContextImple;
import com.arjuna.webservices.SoapFault;
@@ -103,7 +104,7 @@
if (_ctxManager.currentTransaction() != null)
throw new WrongStateException();
- com.arjuna.mw.wsc.context.Context ctx = startTransaction(timeout);
+ com.arjuna.mw.wsc.context.Context ctx = startTransaction(timeout, null);
_ctxManager.resume(new TxContextImple(ctx));
@@ -129,6 +130,47 @@
}
}
+ 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
{
@@ -207,7 +249,18 @@
}
}
- private final com.arjuna.mw.wsc.context.Context startTransaction(int timeout)
+ /**
+ * fetch the coordination context type stashed in the current AT context implememtation
+ * @param current the current AT context implememtation
+ * @return the coordination context type stashed in the current AT context implememtation
+ */
+ private CoordinationContextType getContextType(TxContextImple current)
+ {
+ Context context = (Context)current.context();
+ return context.getCoordinationContext();
+ }
+
+ private final com.arjuna.mw.wsc.context.Context startTransaction(int timeout, TxContextImple current)
throws com.arjuna.wsc.InvalidCreateParametersException,
SystemException
{
@@ -219,8 +272,9 @@
final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
final String messageId = new Uid().stringForm() ;
+ final CoordinationContextType currentContext = (current != null ? getContextType(current) : null);
final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
- _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, null) ;
+ _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, currentContext) ;
if (coordinationContext == null)
{
throw new SystemException(
@@ -264,12 +318,14 @@
* or rollback at this stage. The alternative would be to setup the completionParticipantURL
* and throw the exception from the remote coordinator side (see enlistCompletionParticipants
* for how to do this).
+ *
+ * The same applies for an interposed subordinate transaction created via beginSubordinate.
*/
final EndpointReferenceType completionCoordinator = (EndpointReferenceType) _completionCoordinators.get(id);
if (completionCoordinator == null)
- throw new SecurityException();
+ throw new WrongStateException();
CompletionStub completionStub = new CompletionStub(id, completionCoordinator);
@@ -339,12 +395,14 @@
* or rollback at this stage. The alternative would be to setup the completionParticipantURL
* and throw the exception from the remote coordinator side (see enlistCompletionParticipants
* for how to do this).
+ *
+ * The same applies for an interposed subordinate transaction created via beginSubordinate.
*/
EndpointReferenceType completionCoordinator = (EndpointReferenceType) _completionCoordinators.get(id);
if (completionCoordinator == null)
- throw new SecurityException();
+ throw new WrongStateException();
CompletionStub completionStub = new CompletionStub(id, completionCoordinator);
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubtransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubtransaction.java 2009-02-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubtransaction.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2008,
- * @author JBoss Inc.
- */
-
-package com.arjuna.mw.wst11;
-
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-
-/**
- * This is the interface that allows transactions to be started and terminated.
- * The messaging layer converts the Commit, Rollback and Notify messages into
- * calls on this.
- * Importantly, a UserTransaction does not represent a specific transaction,
- * but rather is responsible for providing access to an implicit per-thread
- * transaction context; it is similar to the UserTransaction in the JTA
- * specification. Therefore, all of the UserTransaction methods implicitly act
- * on the current thread of control.
- *
- * @author Andrew Dinn
- * @version $Id:$
- */
-
-public abstract class UserSubtransaction extends UserTransaction
-{
- /**
- * The transaction.
- */
- private static UserTransaction USER_TRANSACTION ;
-
- /**
- * Get the user transaction.
- * @return the user transaction.
- */
- public static synchronized UserTransaction getUserTransaction()
- {
- return USER_TRANSACTION ;
- }
-
- /**
- * Set the user transaction.
- * @param userTransaction The user transaction.
- */
- public static synchronized void setUserTransaction(final UserTransaction userTransaction)
- {
- USER_TRANSACTION = userTransaction ;
- }
-}
\ No newline at end of file
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransaction.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -94,6 +94,23 @@
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/deploy/WSTXInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java 2009-02-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -117,17 +117,15 @@
final Element docElem = doc.getDocumentElement() ;
final String userTx = getService(docElem, "UserTransaction") ;
- final String userSubTx = getService(docElem, "UserSubtransaction") ;
final String txManager = getService(docElem, "TransactionManager") ;
final String userBa = getService(docElem, "UserBusinessActivity") ;
final String baManager = getService(docElem, "BusinessActivityManager") ;
- if ((userTx == null) || (userSubTx == null) || (txManager == null) || (userBa == null) || (baManager == null))
+ if ((userTx == null) || (txManager == null) || (userBa == null) || (baManager == null))
{
throw new FileNotFoundException(wstxLogger.log_mesg.getString("com.arjuna.mw.wst11.deploy.WSTXI_23"));
}
UserTransaction.setUserTransaction((UserTransaction)ClassLoaderHelper.forName(getClass(), userTx).newInstance()) ;
- UserSubtransaction.setUserTransaction((UserTransaction)ClassLoaderHelper.forName(getClass(), userSubTx).newInstance()) ;
TransactionManager.setTransactionManager((TransactionManager)ClassLoaderHelper.forName(getClass(), txManager).newInstance()) ;
UserBusinessActivity.setUserBusinessActivity((UserBusinessActivity)ClassLoaderHelper.forName(getClass(), userBa).newInstance()) ;
// we only have one choice for the 1.1 business activity manager
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubtransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubtransactionImple.java 2009-02-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubtransactionImple.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -1,170 +0,0 @@
-package com.arjuna.mwlabs.wst11.at.remote;
-
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mw.wsc11.context.Context;
-import com.arjuna.mwlabs.wst11.at.ContextImple;
-import com.arjuna.mwlabs.wst11.at.context.TxContextImple;
-import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.wsc11.ActivationCoordinator;
-import com.arjuna.wsc.InvalidCreateParametersException;
-import com.arjuna.wsc11.messaging.MessageId;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
-import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext;
-
-/**
- * @message com.arjuna.mwlabs.wst11.at.remote.UserSubTransactionImple_1
- * [com.arjuna.mwlabs.wst11.at.remote.UserSubTransactionImple_1] - Received
- * context is null!
- */
-public class UserSubtransactionImple extends UserTransactionImple
-{
-
- public UserSubtransactionImple()
- {
- super();
- }
-
- public void begin () throws WrongStateException, SystemException
- {
- begin(0);
- }
-
- public void begin (int timeout) throws WrongStateException, SystemException
- {
- try
- {
- if (_ctxManager.currentTransaction() == null)
- throw new WrongStateException();
-
- Context ctx = startTransaction(timeout);
-
- _ctxManager.resume(new TxContextImple(ctx));
- }
- catch (InvalidCreateParametersException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (UnknownTransactionException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (SystemException ex)
- {
- tidyup();
-
- throw ex;
- }
- }
-
- public void commit () throws TransactionRolledBackException,
- UnknownTransactionException, SecurityException, SystemException, WrongStateException
- {
- tidyup();
- throw new WrongStateException();
- }
-
- public void rollback () throws UnknownTransactionException, SecurityException, SystemException, WrongStateException
- {
- tidyup();
- throw new WrongStateException();
- }
-
- public String transactionIdentifier ()
- {
- try
- {
- return _ctxManager.currentTransaction().toString();
- }
- catch (SystemException ex)
- {
- return "Unknown";
- }
- catch (NullPointerException ex)
- {
- return "Unknown";
- }
- }
-
- public String toString ()
- {
- return transactionIdentifier();
- }
-
- /*
- * Not sure if this is right as it doesn't map to registering a participant
- * with the coordinator.
- */
-
- private final Context startTransaction(int timeout)
- throws InvalidCreateParametersException,
- SystemException
- {
- try
- {
- // TODO: tricks for per app _activationCoordinatorService config, perhaps:
- //InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/foo.properties");
-
-
-
- final CoordinationContext current = currentCoordinationContext();
- final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
- final String messageId = MessageId.getMessageId() ;
- final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
- _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, current) ;
- if (coordinationContext == null)
- {
- throw new SystemException(
- wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst11.at.remote.UserSubTransactionImple_1"));
- }
- return new ContextImple(coordinationContext) ;
- }
- catch (final InvalidCreateParametersException icpe)
- {
- throw icpe ;
- }
- catch (final SoapFault sf)
- {
- throw new SystemException(sf.getMessage()) ;
- }
- catch (final Exception ex)
- {
- throw new SystemException(ex.toString());
- }
- }
-
- /**
- * get a CoordinationContext based on the one stasahed away in the current TxContext
- */
- public CoordinationContext currentCoordinationContext() throws SystemException
- {
- final TxContextImple txContext = (TxContextImple)_ctxManager.currentTransaction();
- final CoordinationContextType savedContext = txContext.context().getCoordinationContext();
- final CoordinationContext current = new CoordinationContext();
- current.setCoordinationType(savedContext.getCoordinationType());
- current.setExpires(savedContext.getExpires());
- current.setIdentifier(savedContext.getIdentifier());
- current.setRegistrationService(savedContext.getRegistrationService());
- return current;
- }
-
- private final void tidyup ()
- {
- try
- {
- _ctxManager.suspend();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-}
\ No newline at end of file
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -5,6 +5,7 @@
import com.arjuna.mw.wst11.common.Environment;
import com.arjuna.mw.wstx.logging.wstxLogger;
import com.arjuna.mw.wsc11.context.Context;
+import com.arjuna.mw.wst.TxContext;
import com.arjuna.mwlabs.wst11.at.ContextImple;
import com.arjuna.mwlabs.wst11.at.remote.TransactionManagerImple;
import com.arjuna.mwlabs.wst11.at.context.TxContextImple;
@@ -23,6 +24,7 @@
import com.arjuna.wst.WrongStateException;
import com.arjuna.wst11.stub.CompletionStub;
import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext;
import javax.xml.namespace.QName;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
@@ -75,7 +77,7 @@
if (_ctxManager.currentTransaction() != null)
throw new WrongStateException();
- Context ctx = startTransaction(timeout);
+ Context ctx = startTransaction(timeout, null);
_ctxManager.resume(new TxContextImple(ctx));
@@ -101,6 +103,46 @@
}
}
+ 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
{
@@ -180,7 +222,37 @@
}
}
- private final Context startTransaction(int timeout)
+ /**
+ * fetch the coordination context type stashed in the current AT context implememtation
+ * and use it to construct an instance of the coordination context extension type we need to
+ * send down the wire to the activation coordinator
+ * @param current the current AT context implememtation
+ * @return an instance of the coordination context extension type
+ */
+ private CoordinationContext getContext(TxContextImple current)
+ {
+ CoordinationContextType contextType = getContextType(current);
+ CoordinationContext context = new CoordinationContext();
+ context.setCoordinationType(contextType.getCoordinationType());
+ context.setExpires(contextType.getExpires());
+ context.setIdentifier(contextType.getIdentifier());
+ context.setRegistrationService(contextType.getRegistrationService());
+
+ return context;
+ }
+
+ /**
+ * fetch the coordination context type stashed in the current AT context implememtation
+ * @param current the current AT context implememtation
+ * @return the coordination context type stashed in the current AT context implememtation
+ */
+ private CoordinationContextType getContextType(TxContextImple current)
+ {
+ ContextImple contextImple = (ContextImple)current.context();
+ return contextImple.getCoordinationContext();
+ }
+
+ private final Context startTransaction(int timeout, TxContextImple current)
throws com.arjuna.wsc.InvalidCreateParametersException,
SystemException
{
@@ -192,8 +264,9 @@
final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
final String messageId = MessageId.getMessageId() ;
+ final CoordinationContext currentContext = (current != null ? getContext(current) : null);
final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
- _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, null) ;
+ _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, currentContext) ;
if (coordinationContext == null)
{
throw new SystemException(
@@ -237,12 +310,14 @@
* or rollback at this stage. The alternative would be to setup the completionParticipantURL
* and throw the exception from the remote coordinator side (see enlistCompletionParticipants
* for how to do this).
+ *
+ * The same applies for an interposed subordinate transaction created via beginSubordinate.
*/
final W3CEndpointReference completionCoordinator = (W3CEndpointReference) _completionCoordinators.get(id);
if (completionCoordinator == null)
- throw new SecurityException();
+ throw new WrongStateException();
CompletionStub completionStub = new CompletionStub(id, completionCoordinator);
@@ -312,12 +387,14 @@
* or rollback at this stage. The alternative would be to setup the completionParticipantURL
* and throw the exception from the remote coordinator side (see enlistCompletionParticipants
* for how to do this).
+ *
+ * The same applies for an interposed subordinate transaction created via beginSubordinate.
*/
W3CEndpointReference completionCoordinator = (W3CEndpointReference) _completionCoordinators.get(id);
if (completionCoordinator == null)
- throw new SecurityException();
+ throw new WrongStateException();
CompletionStub completionStub = new CompletionStub(id, completionCoordinator);
Modified: labs/jbosstm/trunk/XTS/WSTX/config/wst.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/config/wst.xml 2009-02-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/config/wst.xml 2009-02-19 13:31:32 UTC (rev 25343)
@@ -26,10 +26,6 @@
<!-- <parameter name="className"
value="com.arjuna.mwlabs.wst.at.local.UserTransactionImple"/ -->
</service>
- <service name="UserSubtransaction">
- <parameter name="className"
- value="com.arjuna.mwlabs.wst.at.remote.UserSubtransactionImple"/>
- </service>
<service name="TransactionManager">
<parameter name="className"
value="com.arjuna.mwlabs.wst.at.remote.TransactionManagerImple"/>
Modified: labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml 2009-02-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml 2009-02-19 13:31:32 UTC (rev 25343)
@@ -24,10 +24,6 @@
<parameter name="className"
value="com.arjuna.mwlabs.wst11.at.remote.UserTransactionImple"/>
</service>
- <service name="UserSubtransaction">
- <parameter name="className"
- value="com.arjuna.mwlabs.wst11.at.remote.UserSubtransactionImple"/>
- </service>
<service name="TransactionManager">
<parameter name="className"
value="com.arjuna.mwlabs.wst11.at.remote.TransactionManagerImple"/>
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommit.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -24,7 +24,6 @@
import com.arjuna.mw.wst.TransactionManager;
import com.arjuna.mw.wst.UserTransaction;
-import com.arjuna.mw.wst.UserSubtransaction;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -42,7 +41,6 @@
throws Exception
{
final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubtransaction.getUserTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -55,7 +53,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ust.begin();
+ ut.beginSubordinate();
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitFailInPrepare.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -23,7 +23,6 @@
import com.arjuna.mw.wst.TransactionManager;
import com.arjuna.mw.wst.UserTransaction;
-import com.arjuna.mw.wst.UserSubtransaction;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -43,7 +42,6 @@
throws Exception
{
final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubtransaction.getUserTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -56,7 +54,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ust.begin();
+ ut.beginSubordinate();
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -23,7 +23,6 @@
import com.arjuna.mw.wst.TransactionManager;
import com.arjuna.mw.wst.UserTransaction;
-import com.arjuna.mw.wst.UserSubtransaction;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -43,7 +42,6 @@
throws Exception
{
final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubtransaction.getUserTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -56,7 +54,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ust.begin();
+ ut.beginSubordinate();
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionRollback.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -23,7 +23,6 @@
import com.arjuna.mw.wst.TransactionManager;
import com.arjuna.mw.wst.UserTransaction;
-import com.arjuna.mw.wst.UserSubtransaction;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -41,7 +40,6 @@
throws Exception
{
final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubtransaction.getUserTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -54,7 +52,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ust.begin();
+ ut.beginSubordinate();
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommit.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -23,7 +23,6 @@
import com.arjuna.mw.wst11.TransactionManager;
import com.arjuna.mw.wst11.UserTransaction;
-import com.arjuna.mw.wst11.UserSubtransaction;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -41,7 +40,6 @@
throws Exception
{
final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubtransaction.getUserTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -54,7 +52,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ust.begin();
+ ut.beginSubordinate();
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitFailInPrepare.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -23,7 +23,6 @@
import com.arjuna.mw.wst11.TransactionManager;
import com.arjuna.mw.wst11.UserTransaction;
-import com.arjuna.mw.wst11.UserSubtransaction;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -44,7 +43,6 @@
throws Exception
{
final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubtransaction.getUserTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -57,7 +55,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ust.begin();
+ ut.beginSubordinate();
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -23,7 +23,6 @@
import com.arjuna.mw.wst11.TransactionManager;
import com.arjuna.mw.wst11.UserTransaction;
-import com.arjuna.mw.wst11.UserSubtransaction;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -43,7 +42,6 @@
throws Exception
{
final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubtransaction.getUserTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -56,7 +54,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ust.begin();
+ ut.beginSubordinate();
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-19 13:08:39 UTC (rev 25342)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionRollback.java 2009-02-19 13:31:32 UTC (rev 25343)
@@ -23,7 +23,6 @@
import com.arjuna.mw.wst11.TransactionManager;
import com.arjuna.mw.wst11.UserTransaction;
-import com.arjuna.mw.wst11.UserSubtransaction;
import com.arjuna.mw.wst.TxContext;
import com.arjuna.wst.tests.DemoDurableParticipant;
import com.arjuna.wst.tests.DemoVolatileParticipant;
@@ -41,7 +40,6 @@
throws Exception
{
final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubtransaction.getUserTransaction();
final TransactionManager tm = TransactionManager.getTransactionManager();
final DemoDurableParticipant p1 = new DemoDurableParticipant();
@@ -54,7 +52,7 @@
tm.resume(tx);
tm.enlistForDurableTwoPhase(p1, p1.identifier());
tm.enlistForVolatileTwoPhase(p2, p2.identifier());
- ust.begin();
+ ut.beginSubordinate();
final TxContext stx = tm.suspend();
tm.resume(stx);
tm.enlistForDurableTwoPhase(p3, p3.identifier());
More information about the jboss-svn-commits
mailing list