spring - Drools 6.2.0.Final: EntityManager is closed -
migrating drools 6.2.0.final v5, having issues jpa persistence. environment: jta transactions managed spring.
environment configuration:
// transaction manager spring jtatransactionmanager. seems activate kiespringtransactionmanager/kiespringjpamanager env.set(environmentname.transaction_manager, transactionmanager); env.set(environmentname.entity_manager_factory, entitymanagerfactory);
it seems triggerupdatetransactionsynchronization.beforecompletion() method accesses entitymanager retrieve objects session. however, entity manager has been closed spring in it's own beforecompletion transaction synchronization, hence exception.
is normal behavior? doing wrong?
any appreciated.
exception:
java.lang.illegalstateexception: entitymanager closed @ org.hibernate.ejb.entitymanagerimpl.getsession(entitymanagerimpl.java:95) ~[hibernate-entitymanager-4.2.7.final.jar:4.2.7.final] @ org.hibernate.ejb.abstractentitymanagerimpl.contains(abstractentitymanagerimpl.java:958) ~[hibernate-entitymanager-4.2.7.final.jar:4.2.7.final] @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) ~[na:1.6.0_26] @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) ~[na:1.6.0_26] @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) ~[na:1.6.0_26] @ java.lang.reflect.method.invoke(method.java:597) ~[na:1.6.0_26] @ org.springframework.orm.jpa.extendedentitymanagercreator$extendedentitymanagerinvocationhandler.invoke(extendedentitymanagercreator.java:366) ~[spring-orm-3.2.3.release.jar:3.2.3.release] @ $proxy108.contains(unknown source) ~[na:na] @ org.drools.persistence.triggerupdatetransactionsynchronization.beforecompletion(triggerupdatetransactionsynchronization.java:43) ~[drools-persistence-jpa-6.2.0.final.jar:6.2.0.final] @ org.kie.spring.persistence.springtransactionsynchronizationadapter.beforecompletion(springtransactionsynchronizationadapter.java:54) ~[kie-spring-6.2.0.final.jar:6.2.0.final] @ org.springframework.transaction.support.transactionsynchronizationutils.triggerbeforecompletion(transactionsynchronizationutils.java:106) ~[spring-tx-3.2.3.release.jar:3.2.3.release] @ org.springframework.transaction.support.abstractplatformtransactionmanager.triggerbeforecompletion(abstractplatformtransactionmanager.java:938) [spring-tx-3.2.3.release.jar:3.2.3.release] @ org.springframework.transaction.support.abstractplatformtransactionmanager.processrollback(abstractplatformtransactionmanager.java:835) [spring-tx-3.2.3.release.jar:3.2.3.release] @ org.springframework.transaction.support.abstractplatformtransactionmanager.rollback(abstractplatformtransactionmanager.java:823) [spring-tx-3.2.3.release.jar:3.2.3.release] @ org.springframework.transaction.interceptor.transactionaspectsupport.completetransactionafterthrowing(transactionaspectsupport.java:493) [spring-tx-3.2.3.release.jar:3.2.3.release] @ org.springframework.transaction.interceptor.transactionaspectsupport.invokewithintransaction(transactionaspectsupport.java:264) [spring-tx-3.2.3.release.jar:3.2.3.release] @ org.springframework.transaction.interceptor.transactioninterceptor.invoke(transactioninterceptor.java:94) [spring-tx-3.2.3.release.jar:3.2.3.release] @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) [spring-aop-3.2.3.release.jar:3.2.3.release] @ org.springframework.aop.aspectj.methodinvocationproceedingjoinpoint.proceed(methodinvocationproceedingjoinpoint.java:80) [spring-aop-3.2.3.release.jar:3.2.3.release] @ config.aspect.facadeexceptionwrapping.wrapruntimeintogenericexceptions(facadeexceptionwrapping.java:48) [classes/:na] @ sun.reflect.generatedmethodaccessor113.invoke(unknown source) ~[na:na] @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) ~[na:1.6.0_26] @ java.lang.reflect.method.invoke(method.java:597) ~[na:1.6.0_26] @ org.springframework.aop.aspectj.abstractaspectjadvice.invokeadvicemethodwithgivenargs(abstractaspectjadvice.java:621) [spring-aop-3.2.3.release.jar:3.2.3.release] @ org.springframework.aop.aspectj.abstractaspectjadvice.invokeadvicemethod(abstractaspectjadvice.java:610) [spring-aop-3.2.3.release.jar:3.2.3.release] @ org.springframework.aop.aspectj.aspectjaroundadvice.invoke(aspectjaroundadvice.java:65) [spring-aop-3.2.3.release.jar:3.2.3.release] @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) [spring-aop-3.2.3.release.jar:3.2.3.release] @ org.springframework.aop.interceptor.exposeinvocationinterceptor.invoke(exposeinvocationinterceptor.java:91) [spring-aop-3.2.3.release.jar:3.2.3.release] @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) [spring-aop-3.2.3.release.jar:3.2.3.release] @ org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:204) [spring-aop-3.2.3.release.jar:3.2.3.release] @ $proxy179.completereadonlytask(unknown source) [$proxy179.class:na] @ com.joss.system.webapp.controller.abstracteditorcontroller.completereadonlytask(abstracteditorcontroller.java:283) [classes/:na]
Comments
Post a Comment