use of com.sun.enterprise.transaction.JavaEETransactionManagerSimplified in project Payara by payara.
the class JavaEETransactionManagerJTSDelegate method commitDistributedTransaction.
/**
* An XA transaction commit
*/
public void commitDistributedTransaction() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException {
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE, "TM: commit");
validateTransactionManager();
TransactionManager tm = tmLocal.get();
// monitoring object
Object obj = tm.getTransaction();
JavaEETransactionManagerSimplified javaEETMS = (JavaEETransactionManagerSimplified) javaEETM;
boolean success = false;
if (javaEETMS.isInvocationStackEmpty()) {
try {
tm.commit();
success = true;
} catch (HeuristicMixedException e) {
success = true;
throw e;
} finally {
javaEETMS.monitorTxCompleted(obj, success);
}
} else {
try {
javaEETMS.setTransactionCompeting(true);
tm.commit();
success = true;
/**
* } catch (InvocationException ex) {
* assert false;
*/
} catch (HeuristicMixedException e) {
success = true;
throw e;
} finally {
javaEETMS.monitorTxCompleted(obj, success);
javaEETMS.setTransactionCompeting(false);
}
}
}
use of com.sun.enterprise.transaction.JavaEETransactionManagerSimplified in project Payara by payara.
the class JavaEETransactionManagerJTSDelegate method enlistDistributedNonXAResource.
public boolean enlistDistributedNonXAResource(Transaction tx, TransactionalResource h) throws RollbackException, IllegalStateException, SystemException {
if (useLAO()) {
if (((JavaEETransactionManagerSimplified) javaEETM).resourceEnlistable(h)) {
XAResource res = h.getXAResource();
boolean result = tx.enlistResource(res);
if (!h.isEnlisted())
h.enlistedInTransaction(tx);
return result;
} else {
return true;
}
} else {
throw new IllegalStateException(sm.getString("enterprise_distributedtx.nonxa_usein_jts"));
}
}
Aggregations