}
TransactionSynchronizationRegistry registry = (TransactionSynchronizationRegistry) context.lookup(name);
return (registry.getTransactionStatus() == Status.STATUS_ACTIVE);
} catch (NamingException e) {
IllegalStateException ex = new IllegalStateException("Transaction not active");
ex.initCause(e);
ex.setLinkedException(e);
throw ex;
} finally {
if (context != null) {
try {