Package javax.transaction

Examples of javax.transaction.SystemException


            }
        }
    }

    private void rollbackResources(List rms) throws SystemException {
        SystemException cause = null;
        synchronized (this) {
            status = Status.STATUS_ROLLING_BACK;
        }
        for (Iterator i = rms.iterator(); i.hasNext();) {
            TransactionBranch manager = (TransactionBranch) i.next();
            try {
                manager.getCommitter().rollback(manager.getBranchId());
            } catch (XAException e) {
                log.error("Unexpected exception rolling back " + manager.getCommitter() + "; continuing with rollback", e);
                if (cause == null) {
                    cause = new SystemException(e.errorCode);
                }
            }
        }
        synchronized (this) {
            status = Status.STATUS_ROLLEDBACK;
View Full Code Here


            throw cause;
        }
    }

    private void commitResources(List rms) throws SystemException {
        SystemException cause = null;
        synchronized (this) {
            status = Status.STATUS_COMMITTING;
        }
        for (Iterator i = rms.iterator(); i.hasNext();) {
            TransactionBranch manager = (TransactionBranch) i.next();
            try {
                manager.getCommitter().commit(manager.getBranchId(), false);
            } catch (XAException e) {
                log.error("Unexpected exception committing" + manager.getCommitter() + "; continuing to commit other RMs", e);
                if (cause == null) {
                    cause = new SystemException(e.errorCode);
                }
            }
        }
        //if all resources were read only, we didn't write a prepare record.
        if (!rms.isEmpty()) {
            try {
                txnLog.commit(xid, logMark);
            } catch (LogException e) {
                log.error("Unexpected exception logging commit completion for xid " + xid, e);
                throw (SystemException) new SystemException("Unexpected error logging commit completion for xid " + xid).initCause(e);
            }
        }
        synchronized (this) {
            status = Status.STATUS_COMMITTED;
        }
View Full Code Here

            resourceNames.remove(name);
        }

        public void preparedCommit() throws SystemException {
            if (!resourceNames.isEmpty()) {
                throw new SystemException("This tx does not have all resource managers online, commit not allowed yet");
            }
            super.preparedCommit();
        }
View Full Code Here

            super.preparedCommit();
        }

        public void rollback() throws SystemException {
            if (!resourceNames.isEmpty()) {
                throw new SystemException("This tx does not have all resource managers online, rollback not allowed yet");
            }
            super.rollback();

        }
View Full Code Here

    }
    catch (Exception ex)
    {
      ex.printStackTrace();
     
      throw new SystemException();
    }
  }
View Full Code Here

      this.enlistedResources.add(xaRes);
      try {
         xaRes.start(xid, 0);
      } catch (XAException e) {
         log.errorEnlistingResource(e);
         throw new SystemException(e.getMessage());
      }
      return true;
   }
View Full Code Here

    *                               because the transaction is no longer active.
    * @throws SystemException       If the transaction service fails in an unexpected way.
    */
   public boolean delistResource(XAResource xaRes, int flag)
         throws IllegalStateException, SystemException {
      throw new SystemException("not supported");
   }
View Full Code Here

         } catch (XAException e) {
            log.trace("The resource wants to rollback!", e);
            return false;
         } catch (Throwable th) {
            log.unexpectedErrorFromResourceManager(th);
            throw new SystemException(th.getMessage());
         }
      }
      return true;
   }
View Full Code Here

      this.enlistedResources.add(xaRes);
      try {
         xaRes.start(xid, 0);
      } catch (XAException e) {
         log.error(e);
         throw new SystemException(e.getMessage());
      }
      return true;
   }
View Full Code Here

    *                               because the transaction is no longer active.
    * @throws SystemException       If the transaction service fails in an unexpected way.
    */
   public boolean delistResource(XAResource xaRes, int flag)
         throws IllegalStateException, SystemException {
      throw new SystemException("not supported");
   }
View Full Code Here

TOP

Related Classes of javax.transaction.SystemException

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.