use of com.sun.enterprise.transaction.JavaEETransactionManagerSimplified in project Payara by payara.
the class AppTest method setUp.
public void setUp() {
try {
t = new JavaEETransactionManagerSimplified();
((JavaEETransactionManager) t).setDelegate(new JavaEETransactionManagerXADelegate());
} catch (Exception ex) {
ex.printStackTrace();
assert (false);
}
}
use of com.sun.enterprise.transaction.JavaEETransactionManagerSimplified in project Payara by payara.
the class AppTest method setUp.
public void setUp() {
try {
t = new JavaEETransactionManagerSimplified();
JavaEETransactionManagerDelegate d = new JavaEETransactionManagerJTSDelegate();
t.setDelegate(d);
d.setTransactionManager(t);
} catch (Exception ex) {
ex.printStackTrace();
assert (false);
}
}
use of com.sun.enterprise.transaction.JavaEETransactionManagerSimplified in project Payara by payara.
the class JavaEETransactionManagerJTSDelegate method rollbackDistributedTransaction.
/**
* An XA transaction rollback
*/
public void rollbackDistributedTransaction() throws IllegalStateException, SecurityException, SystemException {
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE, "TM: rollback");
validateTransactionManager();
TransactionManager tm = tmLocal.get();
// monitoring object
Object obj = tm.getTransaction();
JavaEETransactionManagerSimplified javaEETMS = (JavaEETransactionManagerSimplified) javaEETM;
try {
if (javaEETMS.isInvocationStackEmpty()) {
tm.rollback();
} else {
try {
javaEETMS.setTransactionCompeting(true);
tm.rollback();
/**
* } catch (InvocationException ex) {
* assert false;
*/
} finally {
javaEETMS.setTransactionCompeting(false);
}
}
} finally {
javaEETMS.monitorTxCompleted(obj, false);
}
}
use of com.sun.enterprise.transaction.JavaEETransactionManagerSimplified in project Payara by payara.
the class JavaEETransactionManagerJTSDelegate method enlistLAOResource.
public boolean enlistLAOResource(Transaction tran, TransactionalResource h) throws RollbackException, IllegalStateException, SystemException {
if (tran instanceof JavaEETransaction) {
JavaEETransaction tx = (JavaEETransaction) tran;
((JavaEETransactionManagerSimplified) javaEETM).startJTSTx(tx);
// Non XA to LAO
if (useLAO()) {
if (h != null && (tx.getLAOResource() == null)) {
tx.setLAOResource(h);
if (h.isTransactional()) {
XAResource res = h.getXAResource();
return tran.enlistResource(res);
}
}
}
return true;
} else {
// Should not be called
return false;
}
}
use of com.sun.enterprise.transaction.JavaEETransactionManagerSimplified in project Payara by payara.
the class JavaEETransactionManagerJTSDelegate method beginJTS.
public void beginJTS(int timeout) throws NotSupportedException, SystemException {
TransactionManagerImpl tm = (TransactionManagerImpl) tmLocal.get();
tm.begin(timeout);
((JavaEETransactionManagerSimplified) javaEETM).monitorTxBegin(tm.getTransaction());
}
Aggregations