Package com.atomikos.icatch

Examples of com.atomikos.icatch.CompositeTransaction


        CompositeTransactionManager ctm = Configuration
                .getCompositeTransactionManager ();
        if ( ctm == null )
            return;

        CompositeTransaction ct = ctm.getCompositeTransaction ();
        if ( ct != null && ct.getProperty TransactionManagerImp.JTA_PROPERTY_NAME ) != null ) {

            // if we are already in another (parent) tx then reject this,
            // because nested tx rollback can not be supported!!!
            if ( isInTransaction () && !isInTransaction ( ct ) )
                AtomikosSQLException.throwAtomikosSQLException (
                        "Connection accessed by transaction "
                                + ct.getTid ()
                                + " is already in use in another transaction: "
                                + transaction.getTid ()
                                + " Non-XA connections are not compatible with nested transaction use." );

            setTransaction ( ct );
            if ( participant == null ) {
                // make sure we add a participant for commit/rollback
                // notifications
                participant = new AtomikosNonXAParticipant ( this , resourceName );
                participant.setReadOnly ( readOnly );
                ct.addParticipant ( participant );
                originalAutoCommitState = wrapped.getAutoCommit();
                wrapped.setAutoCommit ( false );

            }
        } else {
View Full Code Here


            if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": getAutoCommit() returning false." );
            return ret;
          }
         
          CompositeTransactionManager ctm = Configuration.getCompositeTransactionManager ();
          CompositeTransaction ct = ctm.getCompositeTransaction();
         
            // if we are already in another (parent) tx then reject this,
            // because nested tx rollback can not be supported!!!
            if ( ct != null && !isInTransaction ( ct ) )
                AtomikosSQLException.throwAtomikosSQLException (
                        "Connection accessed by transaction "
                                + ct.getTid ()
                                + " is already in use in another transaction: "
                                + transaction.getTid ()
                                + " Non-XA connections are not compatible with nested transaction use." );
    }
    // check for enlistment
View Full Code Here

 
  boolean isInTransaction ( CompositeTransaction ct )
  {
    boolean ret = false;
    //See case 29060 and 28683 :COPY attribute to avoid race conditions with NPE results
    CompositeTransaction tx = transaction;
    if ( tx != null && ct != null ) {
      ret = tx.isSameTransaction ( ct );
    }
    return ret;
  }
View Full Code Here

    boolean ret = false;
    Reapable handle = getCurrentConnectionProxy();
    if ( handle != null ) {
       CompositeTransactionManager ctm = Configuration
             .getCompositeTransactionManager ();
       CompositeTransaction ct = null;
       if ( ctm != null ) ct = ctm.getCompositeTransaction ();
       if ( ct != null && ct.getProperty TransactionManagerImp.JTA_PROPERTY_NAME ) != null ) {
         DynamicProxy dproxy = ( DynamicProxy ) handle;
         AtomikosThreadLocalConnection previous = (AtomikosThreadLocalConnection) dproxy.getInvocationHandler();
         ret = previous.isInTransaction ( ct );
       }
    }
View Full Code Here

  {
    boolean ret = false;
   
    CompositeTransactionManager tm = Configuration.getCompositeTransactionManager();
   
    CompositeTransaction current = tm.getCompositeTransaction();
    if ( ( current != null ) && ( current.getProperty ( TransactionManagerImp.JTA_PROPERTY_NAME) != null )) {
      ret = sessionHandleState.isInactiveInTransaction(current);
    }
   
    return ret;
  }
View Full Code Here

   */
  private boolean enlist() throws AtomikosSQLException {
    boolean ret = false;
    try {
      if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug( this + ": notifyBeforeUse " + sessionHandleState);
      CompositeTransaction ct = null;
      CompositeTransactionManager ctm = getCompositeTransactionManager();
      if ( ctm != null ) {
        ct = ctm.getCompositeTransaction();
        //first notify the session handle - see case 27857
        sessionHandleState.notifyBeforeUse ( ct , hmsg );
        if (ct != null && ct.getProperty ( TransactionManagerImp.JTA_PROPERTY_NAME ) != null ) {
          ret = true;
          if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": detected transaction " + ct );
          if ( ct.getState().equals(TxState.ACTIVE) ) ct.registerSynchronization(new JdbcRequeueSynchronization( this , ct ));
          else AtomikosSQLException.throwAtomikosSQLException("The transaction has timed out - try increasing the timeout if needed");
        }
      }
     
    } catch (InvalidSessionHandleStateException ex) {
View Full Code Here

  {
    CompositeTransactionManager compositeTransactionManager = getCompositeTransactionManager();
    if (compositeTransactionManager == null) {
      return false; // TM is not running, we can only be in local TX mode
    }
    CompositeTransaction ct = compositeTransactionManager.getCompositeTransaction();
    return sessionHandleState.isActiveInTransaction ( ct );
  }
View Full Code Here

        CompositeTransactionManager ctm = Configuration
                .getCompositeTransactionManager ();
        if ( ctm == null )
            return;

        CompositeTransaction ct = ctm.getCompositeTransaction ();
        if ( ct != null && ct.getProperty TransactionManagerImp.JTA_PROPERTY_NAME ) != null ) {

            // if we are already in another (parent) tx then reject this,
            // because nested tx rollback can not be supported!!!
            if ( isInTransaction () && !isInTransaction ( ct ) )
                AtomikosSQLException.throwAtomikosSQLException (
                        "Connection accessed by transaction "
                                + ct.getTid ()
                                + " is already in use in another transaction: "
                                + transaction.getTid ()
                                + " Non-XA connections are not compatible with nested transaction use." );

            setTransaction ( ct );
            if ( participant == null ) {
                // make sure we add a participant for commit/rollback
                // notifications
                participant = new AtomikosNonXAParticipant ( this , resourceName );
                participant.setReadOnly ( readOnly );
                ct.addParticipant ( participant );
                originalAutoCommitState = wrapped.getAutoCommit();
                wrapped.setAutoCommit ( false );

            }
        } else {
View Full Code Here

            if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": getAutoCommit() returning false." );
            return ret;
          }

          CompositeTransactionManager ctm = Configuration.getCompositeTransactionManager ();
          CompositeTransaction ct = ctm.getCompositeTransaction();

            // if we are already in another (parent) tx then reject this,
            // because nested tx rollback can not be supported!!!
            if ( ct != null && !isInTransaction ( ct ) )
                AtomikosSQLException.throwAtomikosSQLException (
                        "Connection accessed by transaction "
                                + ct.getTid ()
                                + " is already in use in another transaction: "
                                + transaction.getTid ()
                                + " Non-XA connections are not compatible with nested transaction use." );
    }
    // check for enlistment
View Full Code Here

  boolean isInTransaction ( CompositeTransaction ct )
  {
    boolean ret = false;
    //See case 29060 and 28683 :COPY attribute to avoid race conditions with NPE results
    CompositeTransaction tx = transaction;
    if ( tx != null && ct != null ) {
      ret = tx.isSameTransaction ( ct );
    }
    return ret;
  }
View Full Code Here

TOP

Related Classes of com.atomikos.icatch.CompositeTransaction

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.