Package com.atomikos.icatch

Examples of com.atomikos.icatch.CompositeTransactionManager


            addSession ( session );
          }
        } else {
          if ( LOGGER.isInfoEnabled() ) LOGGER.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() )
              LOGGER.logInfo ( this + ": localTransactionMode is enabled on the connection factory - rollback/commit will NOT be part of the global JTA transaction!" );
            else
              LOGGER.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

 
 
  protected void enlist ( String hmsg ) throws JMSException
  {
    CompositeTransaction ct = null;
    CompositeTransactionManager ctm = getCompositeTransactionManager();
    boolean enlist = false;
    StringHeuristicMessage shmsg = new StringHeuristicMessage ( hmsg );
   
    if ( ctm != null ) {
      ct = ctm.getCompositeTransaction();
      if ( ct != null && ct.getProperty ( TransactionManagerImp.JTA_PROPERTY_NAME ) != null ) {
        enlist = true;
      }
    }
   
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

            sessions.add ( session );
          }
        } else {
          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.logWarning ( this + ": localTransactionMode is enabled on the connection factory - rollback/commit will NOT be part of the global JTA transaction!" );
            else
              Configuration.logWarning ( 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

  {
      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

          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

            addSession ( session );
          }
        } else {
          if ( LOGGER.isInfoEnabled() ) LOGGER.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() )
              LOGGER.logInfo ( this + ": localTransactionMode is enabled on the connection factory - rollback/commit will NOT be part of the global JTA transaction!" );
            else
              LOGGER.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

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.