Package com.atomikos.icatch

Examples of com.atomikos.icatch.CompositeTransaction


            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 importTransaction ( Propagation propagation ,
            boolean orphancheck , boolean heur_commit ) throws SysException
    {
        CompositeTransaction ret = ts_.recreateCompositeTransaction (
                propagation, orphancheck, heur_commit );
        // CompositeTransactionManager ctm =
        // Configuration.getCompositeTransactionManager();
        // ctm.resume ( ret );
        return ret;
View Full Code Here

    public Propagation getPropagation () throws SysException
    {
        PropagationImp ret = null;

        CompositeTransaction ct = Configuration
                .getCompositeTransactionManager ().getCompositeTransaction ();
        Stack lineage = (Stack) ct.getLineage ().clone ();
        lineage.push ( ct );
        ret = new PropagationImp ( lineage, ct.isSerial (), ct
                .getTransactionControl ().getTimeout () );

        return ret;
    }
View Full Code Here

        }
    }

    private CompositeTransaction getCompositeTransaction() throws ExtendedSystemException
    {
      CompositeTransaction ct = null;
       try {
             ct = compositeTransactionManager.getCompositeTransaction ();
         } catch ( SysException se ) {
           String msg = "Error while retrieving the transaction for the calling thread";
           LOGGER.logWarning( msg , se);
View Full Code Here

     */

    public void begin ( int timeout ) throws NotSupportedException,
            SystemException
    {
        CompositeTransaction ct = null;
        ResumePreviousTransactionSubTxAwareParticipant resumeParticipant = null;
       
        ct = compositeTransactionManager.getCompositeTransaction();
        if ( ct != null && ct.getProperty JTA_PROPERTY_NAME ) == null ) {
            LOGGER.logWarning ( "JTA: temporarily suspending incompatible transaction: " + ct.getTid() +
                    " (will be resumed after JTA transaction ends)" );
            ct = compositeTransactionManager.suspend();
            resumeParticipant = new ResumePreviousTransactionSubTxAwareParticipant ( ct );
        }
       
        try {
            ct = compositeTransactionManager.createCompositeTransaction ( ( ( long ) timeout ) * 1000 );
            if ( resumeParticipant != null ) ct.addSubTxAwareParticipant ( resumeParticipant );
            if ( ct.isRoot () && getDefaultSerial () )
                ct.getTransactionControl ().setSerial ();
            ct.setProperty ( JTA_PROPERTY_NAME , "true" );
        } catch ( SysException se ) {
          String msg = "Error in begin()";
          LOGGER.logWarning( msg , se );
            throw new ExtendedSystemException ( msg , se
                    .getErrors () );
View Full Code Here

     */

    public Transaction getTransaction () throws SystemException
    {
        TransactionImp ret = null;       
        CompositeTransaction ct = getCompositeTransaction();
        if ( ct != null) ret = getJtaTransactionWithId ( ct.getTid () );
        return ret;
    }
View Full Code Here

        return ret;
    }

  private void suspendUnderlyingCompositeTransaction()
      throws ExtendedSystemException {
    CompositeTransaction ct = null;
        try {
            ct = compositeTransactionManager.suspend();
        } catch ( SysException se ) {
          String msg = "Unexpected error while suspending the existing transaction for the current thread";
          LOGGER.logWarning( msg , se );
View Full Code Here

        String root = null;
        if (lineage == null || lineage.isEmpty ()) root = ct.getTid ();
        else {
            Stack tmp = (Stack) lineage.clone ();
            while ( !tmp.isEmpty() ) {
                CompositeTransaction next = (CompositeTransaction) tmp.pop();
                if (next.isRoot()) root = next.getTid ();
            }
        }
        return (getSiblingMap ( root )).findOrCreateBranchForTransaction ( ct );

    }
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.