Package com.atomikos.datasource.xa

Examples of com.atomikos.datasource.xa.XAResourceTransaction


        ConnectionEventListener
{
 
  protected static void suspendResourceTransaction (
      ResourceTransaction restx ) {
    XAResourceTransaction xarestx = ( XAResourceTransaction ) restx;
    if ( xarestx != null &&
      !xarestx.getState().equals( TxState.TERMINATED )) {
      //check terminated to resolve ISSUE 10102
      xarestx.suspend();
    }
  }
View Full Code Here


          if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ("Calling non-transactional method '" + m.getName() + "' on connection proxy, bypassing enlistment");
          return m.invoke ( wrapped_, args );
        }

        Object ret = null;
        XAResourceTransaction restx = null;
        CompositeTransaction ct = null;
        CompositeTransactionManager ctm = null;
        ctm = Configuration.getCompositeTransactionManager ();
        boolean inTx = false;
        // false if resume should be called (first invocation in tx)

        if ( ctm != null )
            ct = ctm.getCompositeTransaction ();

        inTx = pc_.isInResourceTransaction ();
        if ( ct != null && ct.getProperty TransactionManagerImp.JTA_PROPERTY_NAME ) != null && !pc_.isDiscarded () ) {
            // only enlist if there is a NORMAL tx
            // AND if the pc is not yet discarded (i.e. closed event
            // without a new getConnection() event)
            if ( !inTx ) {
                // not yet enlisted
                // IMPORTANT: we should enlist ONLY ONCE,
                // since we don't have wrappers for each
                // type of dependent object (statements,...)
                // where the real action is
                // Also, for the same reason we can only
                // delist at close time, since that is the
                // earliest detectable moment in time
                // when all these dependent objects are no
                // longer accessible.
                // VITAL ASSERTION FOR THIS TO WORK:
                // after close, the ResourceTransaction association
                // of the pooled connection MUST be null, or the
                // same restx will be reused in different
                // JTA transactions!
                restx = (XAResourceTransaction) resource_
                        .getResourceTransaction ( ct );
                pc_.setResourceTransaction ( restx );
                restx.resume ();
                Configuration
                        .logDebug ( "JDBC ConnectionProxy: using resource transaction: "
                                + restx.getXid () );

            }

        }
View Full Code Here

        ConnectionEventListener
{
 
  protected static void suspendResourceTransaction (
      ResourceTransaction restx ) {
    XAResourceTransaction xarestx = ( XAResourceTransaction ) restx;
    if ( xarestx != null &&
      !xarestx.getState().equals( TxState.TERMINATED )) {
      //check terminated to resolve ISSUE 10102
      xarestx.suspend();
    }
  }
View Full Code Here

TOP

Related Classes of com.atomikos.datasource.xa.XAResourceTransaction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.