Package javax.transaction.xa

Examples of javax.transaction.xa.XAException


    public XAException getXAException() {
        Throwable actualException = getCause();
        if (actualException instanceof XAException) {
            return (XAException)actualException;
        }
        return new XAException(errorCode);
    }
View Full Code Here


   *                         resource.
   */
  public void start(Xid xid, int flag)
  throws XAException {
    if (enlisted)
      throw new XAException("Resource already enlisted.");

    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG,
                 this + ": start(" + xid +
                 ", " + flag + ")");
View Full Code Here

   *                         resource.
   */
  public void end(Xid xid, int flag)
  throws XAException {
    if (! enlisted || ! xid.equals(currentXid))
      throw new XAException("Resource is not enlisted in specified"
                            + " transaction.");

    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG,
                 this + ": end(" + xid +
View Full Code Here

   *
   * @exception XAException  Always thrown.
   */
  public void forget(Xid xid) throws XAException
  {
    throw new XAException("Non implemented method.");
  }
View Full Code Here

            }
            if (ex instanceof XATransactionException) {
                return ((XATransactionException)ex).getXAException();
            }
        }
        return new XAException(XAException.XAER_RMERR);
    }
View Full Code Here

       
    private ConnectionImpl getMMConnection() throws XAException{
      try{
          return this.mmConnection.getConnectionImpl();
      }catch(SQLException e){
        throw new XAException(XAException.XAER_RMFAIL);
      }
    }
View Full Code Here

            if (list.size() > 0) {
                prepared = true;
            }
            return result;
        } catch (SQLException e) {
            XAException xa = new XAException(XAException.XAER_RMERR);
            xa.initCause(e);
            throw xa;
        } finally {
            JdbcUtils.closeSilently(stat);
        }
    }
View Full Code Here

        if (isDebugEnabled()) {
            debugCode("prepare("+JdbcXid.toString(xid)+");");
        }
        checkOpen();
        if (!currentTransaction.equals(xid)) {
            throw new XAException(XAException.XAER_INVAL);
        }
        Statement stat = null;
        try {
            stat = physicalConn.createStatement();
            stat.execute("PREPARE COMMIT " + JdbcXid.toString(xid));
View Full Code Here

        // TODO transaction end: implement this method
        if (flags == TMSUSPEND) {
            return;
        }
        if (!currentTransaction.equals(xid)) {
            throw new XAException(XAException.XAER_OUTSIDE);
        }
        prepared = false;
    }
View Full Code Here

        if (flags == TMRESUME) {
            return;
        }
        if (flags == TMJOIN) {
            if (currentTransaction != null && !currentTransaction.equals(xid)) {
                throw new XAException(XAException.XAER_RMERR);
            }
        } else if (currentTransaction != null) {
            throw new XAException(XAException.XAER_NOTA);
        }
        try {
            physicalConn.setAutoCommit(false);
        } catch (SQLException e) {
            throw convertException(e);
View Full Code Here

TOP

Related Classes of javax.transaction.xa.XAException

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.