Package javax.transaction.xa

Examples of javax.transaction.xa.XAException.initCause()


        return getTraceObjectName() + ": " + physicalConn;
    }

    private static XAException convertException(SQLException e) {
        XAException xa = new XAException(e.getMessage());
        xa.initCause(e);
        return xa;
    }

    private static String quoteFlags(int flags) {
        StringBuilder buff = new StringBuilder();
View Full Code Here


        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

    return "XAConnection : " + physicalConn;
  }

  private static XAException convertException(SQLException e) {
    XAException xa = new XAException(e.getMessage());
    xa.initCause(e);
    return xa;
  }

  private static String quoteFlags(int flags) {
    StringBuilder buff = new StringBuilder();
View Full Code Here

         {
            XAException xae = new XAException("Connection unavailable for xa recovery");
            xae.errorCode = XAException.XA_RETRY;
            if (error != null)
            {
               xae.initCause(error);
            }
            if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
            {
               HornetQJMSServerLogger.LOGGER.debug("Cannot get connectionFactory XAResource", xae);
            }
View Full Code Here

         {
            XAException xae = new XAException("Error trying to connect to any providers for xa recovery");
            xae.errorCode = XAException.XAER_RMERR;
            if (error != null)
            {
               xae.initCause(error);
            }
            if (HornetQJMSServerLogger.LOGGER.isDebugEnabled())
            {
               HornetQJMSServerLogger.LOGGER.debug("Cannot get connectionFactory XAResource", xae);
            }
View Full Code Here

            if (trace) log.trace("Recovery not enabled");
         }
      } catch (Exception e) {
         log.warnExceptionRemovingRecovery(e);
         XAException xe = new XAException(XAException.XAER_RMERR);
         xe.initCause(e);
         throw xe;
      }
   }

   @Override
View Full Code Here

         //rollback transaction before throwing the exception as there's no guarantee the TM calls XAResource.rollback
         //after prepare failed.
         rollback(localTransaction);
         // XA_RBROLLBACK tells the TM that we've rolled back already: the TM shouldn't call rollback after this.
         XAException xe = new XAException(XAException.XA_RBROLLBACK);
         xe.initCause(e);
         throw xe;
      }
   }

   public boolean commit(LocalTransaction localTransaction, boolean isOnePhase) throws XAException {
View Full Code Here

         //this might be possible if the cache has stopped and TM still holds a reference to the XAResource
         if (transaction != null) {
            txTable.failureCompletingTransaction(transaction);
         }
         XAException xe = new XAException(XAException.XAER_RMERR);
         xe.initCause(e);
         throw xe;
      }
   }

   private void handleCommitFailure(Throwable e, boolean onePhaseCommit, LocalTxInvocationContext ctx) throws XAException {
View Full Code Here

         }
      } catch (Throwable e1) {
         log.couldNotRollbackPrepared1PcTransaction(ctx.getCacheTransaction(), e1);
         // inform the TM that a resource manager error has occurred in the transaction branch (XAER_RMERR).
         XAException xe = new XAException(XAException.XAER_RMERR);
         xe.initCause(e);
         throw xe;
      } finally {
         txTable.failureCompletingTransaction(ctx.getTransaction());
      }
      XAException xe = new XAException(XAException.XA_HEURRB);
View Full Code Here

         throw xe;
      } finally {
         txTable.failureCompletingTransaction(ctx.getTransaction());
      }
      XAException xe = new XAException(XAException.XA_HEURRB);
      xe.initCause(e);
      throw xe; //this is a heuristic rollback
   }

   private void commitInternal(LocalTxInvocationContext ctx) throws XAException {
      CommitCommand commitCommand = commandCreator.createCommitCommand(ctx.getGlobalTransaction());
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.