use of com.sun.enterprise.transaction.spi.TransactionalResource in project Payara by payara.
the class JavaEETransactionManagerSimplified method delistComponentResources.
private void delistComponentResources(ComponentInvocation inv, boolean suspend) throws InvocationException {
try {
Transaction tran = (Transaction) inv.getTransaction();
if (isTransactionActive(tran)) {
List l = getExistingResourceList(inv.getInstance(), inv);
if (l == null || l.size() == 0)
return;
int flag = (suspend) ? XAResource.TMSUSPEND : XAResource.TMSUCCESS;
Iterator it = l.iterator();
while (it.hasNext()) {
TransactionalResource h = (TransactionalResource) it.next();
try {
if (h.isEnlisted()) {
delistResource(tran, h, flag);
}
} catch (IllegalStateException ex) {
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE, "TM: Exception in delistResource", ex);
// ignore error due to tx time out
} catch (Exception ex) {
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE, "TM: Exception in delistResource", ex);
it.remove();
handleResourceError(h, ex, tran);
}
}
// END OF IASRI 4658504
}
} catch (Exception ex) {
_logger.log(Level.SEVERE, "enterprise_distributedtx.excep_in_delist", ex);
}
}
use of com.sun.enterprise.transaction.spi.TransactionalResource in project Payara by payara.
the class JavaEETransactionManagerSimplified method processResourceList.
/**
* Called by #componentDestroyed()
*/
private void processResourceList(List l) {
if (l != null && l.size() > 0) {
Iterator it = l.iterator();
while (it.hasNext()) {
TransactionalResource h = (TransactionalResource) it.next();
try {
h.closeUserConnection();
} catch (Exception ex) {
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.WARNING, "enterprise_distributedtx.pooling_excep", ex);
}
}
l.clear();
}
}
use of com.sun.enterprise.transaction.spi.TransactionalResource in project Payara by payara.
the class JavaEETransactionManagerSimplified method enlistComponentResources.
private void enlistComponentResources(ComponentInvocation inv) throws InvocationException {
try {
Transaction tran = (Transaction) inv.getTransaction();
if (isTransactionActive(tran)) {
List l = getExistingResourceList(inv.getInstance(), inv);
if (l == null || l.size() == 0)
return;
Iterator it = l.iterator();
// END IASRI 4705808 TTT002
while (it.hasNext()) {
TransactionalResource h = (TransactionalResource) it.next();
try {
enlistResource(tran, h);
} catch (Exception ex) {
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.WARNING, "enterprise_distributedtx.pooling_excep", ex);
it.remove();
handleResourceError(h, ex, tran);
}
}
// END OF IASRI 4658504
}
} catch (Exception ex) {
_logger.log(Level.SEVERE, "enterprise_distributedtx.excep_in_enlist", ex);
}
}
Aggregations