Package com.arjuna.ats.internal.jta.transaction.jts.subordinate.jca

Examples of com.arjuna.ats.internal.jta.transaction.jts.subordinate.jca.TransactionImple


 
  public void forget (Xid xid) throws XAException
  {
    try
    {
      TransactionImple tx = TxImporter.getImportedTransaction(xid);
     
      if (tx == null)
        throw new XAException(XAException.XAER_INVAL);
     
      tx.doForget();
    }
    catch (Exception ex)
    {
      throw new XAException(XAException.XAER_RMERR);
    }
View Full Code Here


 
  public int prepare (Xid xid) throws XAException
  {
    try
    {
      TransactionImple tx = TxImporter.getImportedTransaction(xid);
     
      if (tx == null)
        throw new XAException(XAException.XAER_INVAL);
     
      switch (tx.doPrepare())
      {
      case TwoPhaseOutcome.PREPARE_READONLY:
        TxImporter.removeImportedTransaction(xid);
       
        return XAResource.XA_RDONLY;       
View Full Code Here

            finished = true;
          }

          if (uid.notEquals(Uid.nullUid()))
          {
            TransactionImple tx = TxImporter.recoverTransaction(uid);

            values.push(tx);
          }
          else
            finished = true;
         
        } while (!finished);

        if (values.size() > 0)
        {
          int index = 0;

          indoubt = new Xid[values.size()];
               
          while (!values.empty())
          {
            TransactionImple id = (TransactionImple) values.pop();

            indoubt[index] = id.baseXid();

            index++;
          }
        }
      }
View Full Code Here

  public void rollback (Xid xid) throws XAException
  {
    try
    {
      TransactionImple tx = TxImporter.getImportedTransaction(xid);

      if (tx == null)
        throw new XAException(XAException.XAER_INVAL);

      if (tx.baseXid() != null)
      {
        tx.doRollback();
       
        TxImporter.removeImportedTransaction(xid);
      }
      else
        throw new XAException(XAException.XA_RETRY);
View Full Code Here

    {
      /*
       * Remember to conver timeout to seconds.
       */
     
      TransactionImple tx = TxImporter.importTransaction(xid, (int) timeout/1000);

      switch (tx.getStatus())
      {
      case Status.STATUS_NO_TRANSACTION:
      case Status.STATUS_UNKNOWN:
        throw new WorkCompletedException(
            jbossatxLogger.logMesg.getString("com.arjuna.ats.jbossatx.jts.jca.inactive"),
            WorkException.TX_RECREATE_FAILED);
      case Status.STATUS_ACTIVE:
        break;
      default:
        throw new WorkCompletedException(
            jbossatxLogger.logMesg.getString("com.arjuna.ats.jbossatx.jts.jca.completing"),
            WorkException.TX_CONCURRENT_WORK_DISALLOWED);
      }

      TxWorkManager.addWork(work, tx);

      /*
       * TODO currently means one synchronization per work item and that
       * instance isn't removed when/if the work item is cancelled and
       * another work item is later added.
       *
       * Synchronizations are pretty lightweight and this add/remove/add
       * scenario will hopefully not happen that much. So, we don't
       * optimise for it at the moment. Re-evaluate if it does become an
       * overhead.
       */

      tx.registerSynchronization(new WorkSynchronization(tx));
    }
    catch (WorkCompletedException ex)
    {
      throw ex;
    }
View Full Code Here

 
  public void startWork (Work work, Xid xid) throws WorkCompletedException
  {
    try
    {
      TransactionImple tx = TxImporter.importTransaction(xid);

      // JBoss doesn't seem to use the work parameter!

      if (!TxWorkManager.getWork(tx).equals(work))
      {
View Full Code Here

 
  public void endWork (Work work, Xid xid)
  {
    try
    {
      TransactionImple tx = TxImporter.importTransaction(xid);

      TransactionManager.transactionManager().suspend();

      TxWorkManager.removeWork(work, tx);
    }
View Full Code Here

 
  public void cancelWork (Work work, Xid xid)
  {
    try
    {
      TransactionImple tx = TxImporter.importTransaction(xid);

      TxWorkManager.removeWork(work, tx);
    }
    catch (Exception ex)
    {
View Full Code Here

TOP

Related Classes of com.arjuna.ats.internal.jta.transaction.jts.subordinate.jca.TransactionImple

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.