Package com.atomikos.icatch

Examples of com.atomikos.icatch.CompositeTransactionManager


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


    if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": closed." );
  }
 
  private boolean isEnlistedInGlobalTransaction()
  {
    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

      this.transaction = tx;
    }

    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

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

 
  public boolean canBeRecycledForCallingThread ()
  {
    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);
      }
    }
   
View Full Code Here

    sessionHandleState.notifySessionErrorOccurred();
    reaped = true;
  }

  private CompositeTransactionManager getCompositeTransactionManager() {
    CompositeTransactionManager ret = Configuration.getCompositeTransactionManager();
    if ( ret == null ) LOGGER.logWarning ( this + ": WARNING: transaction manager not running?" );
    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 );
View Full Code Here

    if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": closed." );
  }

  private boolean isEnlistedInGlobalTransaction()
  {
    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

        this.previous = previous;
    }
   
    private void resume()
    {
        CompositeTransactionManager ctm =
            Configuration.getCompositeTransactionManager();
        if ( ctm == null ) {
            Configuration.logWarning ( "ResumePreviousTransactionSubTxAwareParticipant: no transaction manager found?" );
        }
        else {
            try {
                ctm.resume ( previous );
            }
            catch ( Exception error ) {
                Configuration.logWarning ( "ResumePreviousTransactionSubTxAwareParticipant: could not resume previous transaction" , error );
            }
        }
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.