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

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


   
    /*
     * Check to see if we haven't already imported this thing.
     */
   
    TransactionImple imported = getImportedTransaction(xid);
   
    if (imported == null)
    { 
      imported = new TransactionImple(timeout, xid);
     
      _transactions.put(new XidImple(xid), imported);
    }
   
    return imported;
View Full Code Here


  public static TransactionImple recoverTransaction (Uid actId) throws XAException
  {
    if (actId == null)
      throw new IllegalArgumentException();
   
    TransactionImple recovered = new TransactionImple(actId);
    TransactionImple tx = (TransactionImple) _transactions.get(recovered.baseXid());

    if (tx == null)
    {
      recovered.recordTransaction();
View Full Code Here

  public void commit (Xid xid, boolean onePhase) throws XAException
  {
    try
    {
      TransactionImple tx = TxImporter.getImportedTransaction(xid);
     
      if (tx == null)
        throw new XAException(XAException.XAER_INVAL);
     
      if (onePhase)
        tx.doOnePhaseCommit();
      else
        tx.doCommit();
     
      TxImporter.removeImportedTransaction(xid);
    }
    catch (XAException ex)
    {
View Full Code Here

 
  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);

      tx.doRollback();
     
      TxImporter.removeImportedTransaction(xid);
    }
    catch (XAException ex)
    {
View Full Code Here

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

      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

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.