/* check whether the transaction is still active before scanning the exception handlers.
* that way we can load the exception handlers lazily
* see https://jira.jboss.org/jira/browse/JBPM-1775 */
JbpmContext jbpmContext = executionContext.getJbpmContext();
if (jbpmContext != null) {
Services services = jbpmContext.getServices();
if (services != null) {
Service service = services.getPersistenceService();
if (service instanceof DbPersistenceService) {
DbPersistenceService persistenceService = (DbPersistenceService) service;
return persistenceService.isTransactionActive() || persistenceService.getTransaction() == null;
}
}