/** * AS7-6586 requires that the container avoid closing the EntityManager while the application * may be using the EntityManager in a different thread. If the transaction has been rolled * back, will check if the current thread is the Arjuna transaction manager Reaper thread. It is not * safe to call EntityManager.close from the Reaper thread, so false is returned. * * TODO: switch to depend on JBTM-1556 instead of checking the current thread name. * * @return */ private boolean safeToClose() { if (this.entityManager.isOpen()) { return !TxUtils.isTransactionManagerTimeoutThread(); } return true; }
/** * AS7-6586 requires that the container avoid closing the EntityManager while the application * may be using the EntityManager in a different thread. If the transaction has been rolled * back, will check if the current thread is the Arjuna transaction manager Reaper thread. It is not * safe to call EntityManager.close from the Reaper thread, so false is returned. * * TODO: switch to depend on JBTM-1556 instead of checking the current thread name. * * @return */ private boolean safeToClose() { if (this.entityManager.isOpen()) { return !TxUtils.isTransactionManagerTimeoutThread(); } return true; }