Environment:
|
For persistent usage of the BPM component, upon undeploy of an application, the SwitchYard code eagerly closes the EntityManager, and then disposes of the stateful KieSession. The Drools persistence code eagerly tries to do an (unnecessary) commit on the EntityManager itself during its disposal, but issues a WARNing to the log that the EntityManager was already closed. What we should do is change the ordering of things on application undeploy, so that the KieSession disposal occurs before our EntityManager close.
13:02:50,660 WARN [org.drools.persistence.SingleSessionCommandService] (MSC service thread 1-3) Could not commit session: java.lang.IllegalStateException: EntityManager is closed
at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1181) [hibernate-entitymanager-4.2.0.Final-redhat-1.jar:4.2.0.Final-redhat-1]
at org.drools.persistence.jpa.JpaPersistenceContext.joinTransaction(JpaPersistenceContext.java:42) [drools-persistence-jpa-6.0.0.Beta4.jar:6.0.0.Beta4]
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:367) [drools-persistence-jpa-6.0.0.Beta4.jar:6.0.0.Beta4]
at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.halt(CommandBasedStatefulKnowledgeSession.java:393) [drools-core-6.0.0.Beta4.jar:6.0.0.Beta4]
at org.switchyard.component.common.knowledge.util.Disposals$4.dispose(Disposals.java:113)
at org.switchyard.component.common.knowledge.session.KnowledgeDisposer.dispose(KnowledgeDisposer.java:53)
at org.switchyard.component.common.knowledge.exchange.KnowledgeExchangeHandler.disposeStatefulSession(KnowledgeExchangeHandler.java:162)
at org.switchyard.component.common.knowledge.exchange.KnowledgeExchangeHandler.doStop(KnowledgeExchangeHandler.java:201)
at org.switchyard.component.bpm.exchange.BPMExchangeHandler.doStop(BPMExchangeHandler.java:136) [switchyard-component-bpm-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
at org.switchyard.deploy.BaseServiceHandler.stop(BaseServiceHandler.java:90)
at org.switchyard.deploy.internal.Deployment.undeployImplementations(Deployment.java:647)
at org.switchyard.deploy.internal.Deployment.stop(Deployment.java:165)
at org.switchyard.as7.extension.deployment.SwitchYardDeployment.stop(SwitchYardDeployment.java:118) [switchyard-deploy-jboss-as7-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
at org.switchyard.as7.extension.services.SwitchYardService.stop(SwitchYardService.java:88) [switchyard-deploy-jboss-as7-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
at org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1911)
at org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:1874)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_51]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_51]
13:02:50,664 WARN [org.switchyard.component.common.knowledge.util.Disposals] (MSC service thread 1-3) problem disposing KieSession: EntityManager is closed
|