Example usage for javax.transaction RollbackException toString

List of usage examples for javax.transaction RollbackException toString

Introduction

In this page you can find the example usage for javax.transaction RollbackException toString.

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:org.csc.phynixx.xa.PhynixxManagedXAConnection.java

/**
 * if necessary the current xa resource is enlisted in the current TX.
 * <p/>/*from   w w w . j av  a  2 s .c  om*/
 * The enlistment calls the
 * {@link javax.transaction.xa.XAResource#start(javax.transaction.xa.Xid, int)}
 * . This call associates the Xid with the current instance
 */
private void enlistTransaction() {

    this.cleanupTransactionBinding();

    TransactionBindingType transactionBindingType = this.transactionBinding.getTransactionBindingType();

    // not associated to global transaction, try to associate a global
    // transaction
    if (this.isInGlobalTransaction() && transactionBindingType != TransactionBindingType.GlobalTransaction) {
        try {
            Transaction ntx = this.transactionManager.getTransaction();

            // Bitronix calls start on reaction of enlist --- check if cycle
            if (!enlisted && ntx != null) {
                this.enlisted = true;
                // enlisted makes startTransaactionalBranch calling
                this.enlisted = ntx.enlistResource(this.xaResource);
                if (!enlisted) {
                    LOG.error("Enlisting " + xaResource + " failed");
                } else {

                }
            } else {
                LOG.debug("SampleXAConnection:connectionRequiresTransaction (no globalTransaction found)");
            }
        } catch (RollbackException n) {
            LOG.error("SampleXAConnection:prevokeAction enlistResource exception : " + n.toString());
        } catch (SystemException n) {
            LOG.error("SampleXAConnection:connectionRequiresTransaction " + n + "\n"
                    + ExceptionUtils.getStackTrace(n));
            throw new DelegatedRuntimeException(n);
        }
    } else if (transactionBindingType == TransactionBindingType.NoTransaction) {
        this.transactionBinding.activateLocalTransaction(
                new LocalTransactionProxy<C>(this.managedConnectionFactory.getManagedConnection()));
    } else { // In Global Transaction and associated to a global transaction
             // => nothing to do
        if (this.isInGlobalTransaction()
                && transactionBindingType == TransactionBindingType.GlobalTransaction) {
            // Not in Global Transaction and associated to a local
            // transaction => nothing to do
        } else if (!this.isInGlobalTransaction()
                && transactionBindingType == TransactionBindingType.LocalTransaction) {
        }
    }

}