Package com.atomikos.icatch

Examples of com.atomikos.icatch.CompositeTransactionManager


            Object ret = Boolean.FALSE;
            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 (
View Full Code Here


  public boolean canBeRecycledForCallingThread()
  {
    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

        }

        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
View Full Code Here

    }

    private void updateInTransaction () throws SQLException
    {
        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 ) )
View Full Code Here

          m = "JtaMessageProducer.enlist: Illegal multi-threaded use: object already enlisted by different thread [" + nameOfLastThreadToEnlist_ + "]";
          throw new JMSException ( m );
      }
 
     
      CompositeTransactionManager ctm = Configuration
              .getCompositeTransactionManager ();
 
      if ( ctm == null )
          throw new JMSException (
                  "JTA MessageProducer: requires Atomikos TransactionsEssentials to be running! Please make sure to start a transaction first." );
 
      CompositeTransaction ct = ctm.getCompositeTransaction ();
      if ( ct == null || ct.getProperty TransactionManagerImp.JTA_PROPERTY_NAME ) == null )
          throw new JMSException (
                  "JTA transaction required for JtaMessageProducer" );
 
      restx_ = (XAResourceTransaction) res_.getResourceTransaction ( ct );
View Full Code Here

  {
      if ( restx_ != null )
          throw new JMSException (
                  "JtaMessageConsumer.enlist: already enlisted" );
 
      CompositeTransactionManager ctm = Configuration
              .getCompositeTransactionManager ();
 
      if ( ctm == null )
          throw new JMSException (
                  "JtaMessageConsumer: requires Atomikos TransactionsEssentials to be running! Please make sure to start a transaction first." );
 
      CompositeTransaction ct = ctm.getCompositeTransaction ();
      if ( ct == null || ct.getProperty TransactionManagerImp.JTA_PROPERTY_NAME ) == null )
          throw new JMSException (
                  "JTA transaction required for JtaMessageConsumer" );
 
      restx_ = (XAResourceTransaction) res_.getResourceTransaction ( ct );
View Full Code Here

 
  public boolean canBeRecycledForCallingThread ()
  {
    boolean ret = false;
    if ( currentProxy != null ) {
      CompositeTransactionManager tm = Configuration.getCompositeTransactionManager();
     
      CompositeTransaction current = tm.getCompositeTransaction();
      if ( ( current != null ) && ( current.getProperty ( TransactionManagerImp.JTA_PROPERTY_NAME) != null )) {
        DynamicProxy dproxy = ( DynamicProxy ) currentProxy;
        AtomikosJmsConnectionProxy proxy = (AtomikosJmsConnectionProxy) dproxy.getInvocationHandler();
        //recycle if either inactive in this tx, OR if active (since a new session will be created anyway, and
        //concurrent sessions are allowed on the same underlying connection!
View Full Code Here

            addSession ( session );
          }
        } else {
          if ( Configuration.isInfoLoggingEnabled() ) Configuration.logInfo ( this + ": creating NON-XA session..." );
          CompositeTransaction ct = null;
          CompositeTransactionManager ctm = Configuration.getCompositeTransactionManager();
          if ( ctm != null ) ct = ctm.getCompositeTransaction();
          if ( ct != null && ct.getProperty ( TransactionManagerImp.JTA_PROPERTY_NAME ) != null ) {
            if ( transactedFlag.booleanValue() )
              Configuration.logInfo ( this + ": localTransactionMode is enabled on the connection factory - rollback/commit will NOT be part of the global JTA transaction!" );
            else
              Configuration.logInfo ( this + ": you are creating a JMS session in non-transacted mode - the resulting JMS work will NOT be part of the JTA transaction!" );
View Full Code Here

    //dummy return to make compiler happy
    return null;
  }
 
  private synchronized Session recycleSession() {
    CompositeTransactionManager tm = Configuration.getCompositeTransactionManager();
    if (tm == null)
      return null;
   
    CompositeTransaction current = tm.getCompositeTransaction();
    if ( ( current != null ) && ( current.getProperty ( TransactionManagerImp.JTA_PROPERTY_NAME) != null )) {
      synchronized (sessions) {
        for (int i=0; i<sessions.size() ;i++) {
          Session session = (Session) sessions.get(i);
          DynamicProxy dproxy = ( DynamicProxy ) session;
View Full Code Here

 


  protected CompositeTransactionManager getCompositeTransactionManager()
  {
    CompositeTransactionManager ret = null;
    ret = Configuration.getCompositeTransactionManager();
    return ret;
  }
View Full Code Here

TOP

Related Classes of com.atomikos.icatch.CompositeTransactionManager

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.