Created attachment 597804 [details] error stacktrace Description of problem: Having several stateful knowledge sessions configured with JPA and Spring Transaction Manager. When these sessions are being disposed, following exception is thrown: java.lang.IllegalStateException: EntityManager is closed at org.hibernate.ejb.EntityManagerImpl.getSession(EntityManagerImpl.java:66) ... (see an attachment for the complete stacktrace) Additional info: Problem is connected with application-scoped entity manager, which is shared between sessions within the same thread. After the first session with original entity manager is disposed, the other sessions see that entity manager closed and are unable to complete the dispose command. The reproducer will be added soon.
The promised reproducer: https://github.com/droolsjbpm/droolsjbpm-integration/pull/30
fixed by this commit: https://github.com/droolsjbpm/drools/commit/96b4bae1a494b1dc8d2cb92ee263d7da209cc02f
verified on 5.3.0.BRMS-P01