Package com.atomikos.icatch

Examples of com.atomikos.icatch.CompositeTransaction


    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();
    if ( tm != null ) { //null for non-JTA use where recycling is pointless anyway
      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 ( LOGGER.isDebugEnabled() ) LOGGER.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 ( LOGGER.isDebugEnabled() ) LOGGER.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

            RecoveryCoordinator adaptor )
    {
        Stack lineage = propagation.getLineage ();

        // replace most recent ancestor by adaptor
        CompositeTransaction remote = (CompositeTransaction) lineage.peek ();
        CompositeTransaction ct = new CompositeTransactionAdaptor ( lineage,
                remote.getTid (), remote.isSerial (), adaptor , remote.getCompositeCoordinator().isRecoverableWhileActive() );

        lineage.pop ();

        // push adaptor on ancestor stack, in the place of the remote
View Full Code Here

    public boolean equals ( Object o )
    {
        boolean ret = false;
        if ( o instanceof PropagationImp ) {
            PropagationImp other = (PropagationImp) o;
            CompositeTransaction otherCt = (CompositeTransaction) other.lineage_
                    .peek ();
            CompositeTransaction ct = (CompositeTransaction) lineage_.peek ();

            // if the lowermost parents are the same then the propagation
            // is also the same
            ret = ct.isSameTransaction ( otherCt );
        }
        return ret;
    }
View Full Code Here

    public int hashCode ()
    {
        int ret = 0;

        CompositeTransaction ct = (CompositeTransaction) lineage_.peek ();
        ret = ct.getTid ().hashCode ();

        return ret;
    }
View Full Code Here

     */

    public CompositeTransaction createSubTransaction () throws SysException,
            IllegalStateException
    {
        CompositeTransaction ret = localGetTransactionStateHandler().createSubTransaction ();
        printMsg ( "createSubTransaction(): created new SUBTRANSACTION "
                + ret.getTid () + " for existing transaction " + getTid (),
                Console.INFO );
        return ret;
    }
View Full Code Here

    {

        Stack ret = null;
        synchronized ( threadtotxmap_ ) {
            ret = (Stack) threadtotxmap_.remove ( thread );
            CompositeTransaction tx = (CompositeTransaction) ret.peek ();
            txtothreadmap_.remove ( tx );
        }
        return ret;
    }
View Full Code Here

    private void restoreThreadMappings ( Stack stack , Thread thread )
            throws IllegalStateException
    {
      //case 21806: callbacks to ct to be made outside synchronized block
      CompositeTransaction tx = (CompositeTransaction) stack.peek ();
      tx.addSubTxAwareParticipant ( this ); //step 1
     
        synchronized ( threadtotxmap_ ) {
          //between step 1 and here, intermediate timeout/rollback of the ct
          //may have happened; make sure to check or we add a thread mapping
          //that will never be removed!
          Object state = tx.getState();
         
          if ( TxState.ACTIVE.equals ( state ) || TxState.MARKED_ABORT.equals ( state ) ) {
            //also resume for marked abort - see case 26398
            Stack txs = (Stack) threadtotxmap_.get ( thread );
            if ( txs != null )
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.