Examples of XAXactId


Examples of org.apache.derby.iapi.store.access.xa.XAXactId

     */   
    public final synchronized void commit(Xid xid, boolean onePhase)
                                            throws XAException {
        checkXAActive();
        // ensure immtable and correct equals method.
        XAXactId xid_im = new XAXactId(xid);
        XATransactionState tranState = getTransactionState(xid_im);
       
        if (tranState == null) {
            XAResourceManager rm = ra.getXAResourceManager();
            ContextManager inDoubtCM = rm.find(xid);
View Full Code Here

Examples of org.apache.derby.iapi.store.access.xa.XAXactId

        } catch (SQLException sqle) {
            throw wrapInXAException(sqle);
        }
       
        // ensure immtable and correct equals method.
        XAXactId xid_im = new XAXactId(xid);
       
        boolean endingCurrentXid = false;
       
        // must match the Xid from start()
        if (currentXid != null) {
View Full Code Here

Examples of org.apache.derby.iapi.store.access.xa.XAXactId

     */
    public final synchronized int prepare(Xid xid) throws XAException {
        checkXAActive();
       
        // ensure immtable and correct equals method.
        XAXactId xid_im = new XAXactId(xid);
       
        XATransactionState tranState = getTransactionState(xid_im);
       
        if (tranState == null) {
            XAResourceManager rm = ra.getXAResourceManager();
View Full Code Here

Examples of org.apache.derby.iapi.store.access.xa.XAXactId

    public final synchronized void forget(Xid xid) throws XAException {
       
        checkXAActive();
       
        // ensure immtable and correct equals method.
        XAXactId xid_im = new XAXactId(xid);
       
        XATransactionState tranState = getTransactionState(xid_im);
        if (tranState == null) {
            XAResourceManager rm = ra.getXAResourceManager();
           
View Full Code Here

Examples of org.apache.derby.iapi.store.access.xa.XAXactId

     */
    public final synchronized void rollback(Xid xid) throws XAException {
        checkXAActive();
       
        // ensure immtable and correct equals method.
        XAXactId xid_im = new XAXactId(xid);
       
        XATransactionState tranState = getTransactionState(xid_im);
       
        if (tranState == null) {
            XAResourceManager rm = ra.getXAResourceManager();
View Full Code Here

Examples of org.apache.derby.iapi.store.access.xa.XAXactId

        // JDBC 3.0 section 12.3 - One transaction associated with a XAConnection
        if (currentXid != null)
            throw new XAException(XAException.XAER_PROTO);
       
        // ensure immtable and correct equals method.
        XAXactId xid_im = new XAXactId(xid);
       
        XATransactionState tranState = getTransactionState(xid_im);
       
        switch (flags) {
            case XAResource.TMNOFLAGS:
                if (tranState != null)
                    throw new XAException(XAException.XAER_DUPID);
               
                try {
                   
                    if (con.realConnection == null) {
                        con.openRealConnection();
                       
                        if (con.currentConnectionHandle != null) {
                           
                            // since this is a new connection, set its complete
                            // state according to the application's Connection
                            // handle view of the world.
                            con.currentConnectionHandle.setState(true);
                            con.realConnection.setApplicationConnection
                                    (con.currentConnectionHandle);
                        }
                       
                    } else {
                       
                        // XAResource.start() auto commits in DB2 when in
                        // auto commit mode.
                        if (con.currentConnectionHandle != null) {
                            if (con.currentConnectionHandle.getAutoCommit())
                                con.currentConnectionHandle.rollback();
                        }
                        if (!con.realConnection.transactionIsIdle())
                            throw new XAException(XAException.XAER_OUTSIDE);
                       
                        if (con.currentConnectionHandle != null) {
                            // It is possible that the isolation level state
                            // in connection handle has gotten out of sync
                            // with the real isolation level. This can happen
                            // if SLQ instead of JDBC api has been used to set
                            // the isolation level. The code below will check
                            // if isolation was set using JDBC or SQL and if
                            // yes, then it will update the isolation state
                            // in BrokeredConnection with EmbedConnection's
                            // isolation level.
                            con.currentConnectionHandle.getIsolationUptoDate();
                            // we have a current handle so we need to keep
                            // the connection state of the current connection.
                            con.currentConnectionHandle.setState(true);
                           
                            // At the local to global transition we need
                            // to discard and close any open held result
                            // sets, a rollback will do this.
                            con.realConnection.rollback();
                        } else {
                            con.resetRealConnection();
                        }
                       
                    }
                   
                    // Global connections are always in auto commit false mode.
                    con.realConnection.setAutoCommit(false);
                   
                    // and holdability false (cannot hold cursors across
                    // XA transactions.
                    con.realConnection.setHoldability(
                            ResultSet.CLOSE_CURSORS_AT_COMMIT);
                   
                    con.realConnection.getLanguageConnection().
                            getTransactionExecute().
                            createXATransactionFromLocalTransaction(
                                                xid_im.getFormatId(),
                                                xid_im.getGlobalTransactionId(),
                                                xid_im.getBranchQualifier());
                   
                   
                } catch (StandardException se) {
                    throw wrapInXAException(se);
                } catch (SQLException sqle) {
View Full Code Here

Examples of org.apache.derby.iapi.store.access.xa.XAXactId

    {
        if (xid != null) {
            boolean local  = ( xid.getFormatId() == -1);
            if (!local) {
                try {
                    XAXactId xid_im = new XAXactId(xid);
                    getResourceAdapter().cancelXATransaction(
                        xid_im,
                        MessageId.CONN_CLOSE_XA_TRANSACTION_ROLLED_BACK
                    );
                } catch (XAException e) {
View Full Code Here

Examples of org.apache.derby.iapi.store.access.xa.XAXactId

    // JDBC 3.0 section 12.3 - One transaction associated with a XAConnection
    if (currentXid != null)
      throw new XAException(XAException.XAER_PROTO);

    // ensure immtable and correct equals method.
    XAXactId xid_im = new XAXactId(xid);

    XATransactionState tranState = getTransactionState(xid_im);

    switch (flags) {
    case XAResource.TMNOFLAGS:
      if (tranState != null)
        throw new XAException(XAException.XAER_DUPID);

      try {

        if (realConnection == null) {
          openRealConnection();

          if (currentConnectionHandle != null) {

            // since this is a new connection, set its complete
            // state according to the application's Connection
            // handle view of the world.
            currentConnectionHandle.setState(true);
            realConnection.setApplicationConnection(currentConnectionHandle);
          }

        } else {

          // XAResource.start() auto commits in DB2 when in auto commit mode.
          if (currentConnectionHandle != null) {
            if (currentConnectionHandle.getAutoCommit())
              currentConnectionHandle.rollback();
          }
          if (!realConnection.transactionIsIdle())
            throw new XAException(XAException.XAER_OUTSIDE);

          if (currentConnectionHandle != null) {

            // we have a current handle so we need to keep
            // the connection state of the current connection.
            currentConnectionHandle.setState(true);

            // At the local to global transition we need to discard
            // and close any open held result sets, a rollback will do this.
            realConnection.rollback();
          } else {
            resetRealConnection();
          }

        }

        // Global connections are always in auto commit false mode.
        realConnection.setAutoCommit(false);

        // and holdability false (cannot hold cursors across XA transactions.
        realConnection.setHoldability(JDBC30Translation.CLOSE_CURSORS_AT_COMMIT);

        realConnection.getLanguageConnection().
          getTransactionExecute().createXATransactionFromLocalTransaction(
             xid_im.getFormatId(),
             xid_im.getGlobalTransactionId(),
             xid_im.getBranchQualifier());


      } catch (StandardException se) {
        throw wrapInXAException(se);
     
View Full Code Here

Examples of org.apache.derby.iapi.store.access.xa.XAXactId

  public final synchronized void end(Xid xid, int flags) throws XAException
  {
    checkXAActive();

    // ensure immtable and correct equals method.
    XAXactId xid_im = new XAXactId(xid);

    boolean endingCurrentXid = false;

    // must match the Xid from start()
    if (currentXid != null) {
View Full Code Here

Examples of org.apache.derby.iapi.store.access.xa.XAXactId

  public final synchronized int prepare(Xid xid) throws XAException
  {
    checkXAActive();

    // ensure immtable and correct equals method.
    XAXactId xid_im = new XAXactId(xid);

    XATransactionState tranState = getTransactionState(xid_im);

    if (tranState == null) {
      XAResourceManager rm = ra.getXAResourceManager();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.