[jira] [Commented] (OLINGO-882) Olingo closes EntityManager which is managed by the application server
[ https://issues.apache.org/jira/browse/OLINGO-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15482149#comment-15482149 ] Manuel Blechschmidt commented on OLINGO-882: Hi Guys, just to let you know. I just created a blueprint architecture project connecting wildfly, jpa, olingo and OpenUI5 together: https://github.com/ManuelB/blueprint It also has a solution for the described use case here: https://github.com/ManuelB/blueprint/blob/master/src/main/java/de/incentergy/architecture/JpaODataServiceFactory.java Hope that helps Manuel > Olingo closes EntityManager which is managed by the application server > -- > > Key: OLINGO-882 > URL: https://issues.apache.org/jira/browse/OLINGO-882 > Project: Olingo > Issue Type: Bug > Components: odata2-jpa >Affects Versions: V2 2.0.6 > Environment: Java 1.8, wildfly 8 >Reporter: Manuel Blechschmidt >Assignee: Michael Bolz > Fix For: V2 2.0.7 > > > Like I already mentioned in ONLINGO-754 the EntityManager is closed by > Olingo. This creates a problem if the EntityManager is managed by an > application server. > We now decomposed our application and are consuming olingo through a > transitive dependency. Therefore our dirty hack by "overwritten" classes by > putting them in our own codebase does not work anymore. > The problem is here: > {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} > https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java > {code} > I will implement my own ODataJPAProcessor to workaround > {code} > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)\n\tat > org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat > > org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat > > de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat > org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat > org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat > > de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat > java.lang.reflect.Method.invoke(Method.java:498)\n\tat > org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > >
[jira] [Commented] (OLINGO-882) Olingo closes EntityManager which is managed by the application server
[ https://issues.apache.org/jira/browse/OLINGO-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15335641#comment-15335641 ] Alex Key commented on OLINGO-882: - Hi all, sorry to say that, but IllegalStateException is still thrown by ODataJPATransactionLocalDefault constructor, which has em.getTransaction() call. Here's stacktrace: {noformat} java.lang.IllegalStateException: A JTA EntityManager can not use the EntityTransaction API. See JPA 1.0 section 5.5 at org.apache.openejb.persistence.JtaEntityManager.getTransaction(JtaEntityManager.java:349) at org.apache.olingo.odata2.jpa.processor.core.ODataJPATransactionLocalDefault.(ODataJPATransactionLocalDefault.java:31) at org.apache.olingo.odata2.jpa.processor.core.ODataJPAContextImpl.getODataJPATransaction(ODataJPAContextImpl.java:178) at org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImpl.setTransaction(JPAProcessorImpl.java:451) at org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImpl.processCreate(JPAProcessorImpl.java:335) at org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImpl.process(JPAProcessorImpl.java:223) at org.apache.olingo.odata2.jpa.processor.core.ODataJPAProcessorDefault.createEntity(ODataJPAProcessorDefault.java:122) at org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:79) at org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130) at org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164) at org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:86) {noformat} Best regards, Alex > Olingo closes EntityManager which is managed by the application server > -- > > Key: OLINGO-882 > URL: https://issues.apache.org/jira/browse/OLINGO-882 > Project: Olingo > Issue Type: Bug > Components: odata2-jpa >Affects Versions: V2 2.0.6 > Environment: Java 1.8, wildfly 8 >Reporter: Manuel Blechschmidt >Assignee: Michael Bolz > Fix For: V2 2.0.7 > > > Like I already mentioned in ONLINGO-754 the EntityManager is closed by > Olingo. This creates a problem if the EntityManager is managed by an > application server. > We now decomposed our application and are consuming olingo through a > transitive dependency. Therefore our dirty hack by "overwritten" classes by > putting them in our own codebase does not work anymore. > The problem is here: > {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} > https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java > {code} > I will implement my own ODataJPAProcessor to workaround > {code} > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)\n\tat > org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat > > org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat > > de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat > org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat > org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat > > de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat > java.lang.reflect.Method.invoke(Method.java:498)\n\tat > org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > >
[jira] [Commented] (OLINGO-882) Olingo closes EntityManager which is managed by the application server
[ https://issues.apache.org/jira/browse/OLINGO-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15258892#comment-15258892 ] Michael Bolz commented on OLINGO-882: - Hi [~manuel_b], Thanks for checking. Based on this I merged the [feature now into the master|https://git1-us-west.apache.org/repos/asf?p=olingo-odata2.git;a=commit;h=a838b6960bbbeac98a2afe819ee4ce9371791051] and resolve/close this issue. Best Regards, Michael > Olingo closes EntityManager which is managed by the application server > -- > > Key: OLINGO-882 > URL: https://issues.apache.org/jira/browse/OLINGO-882 > Project: Olingo > Issue Type: Bug > Components: odata2-jpa >Affects Versions: V2 2.0.6 > Environment: Java 1.8, wildfly 8 >Reporter: Manuel Blechschmidt >Assignee: Michael Bolz > Fix For: V2 2.0.7 > > > Like I already mentioned in ONLINGO-754 the EntityManager is closed by > Olingo. This creates a problem if the EntityManager is managed by an > application server. > We now decomposed our application and are consuming olingo through a > transitive dependency. Therefore our dirty hack by "overwritten" classes by > putting them in our own codebase does not work anymore. > The problem is here: > {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} > https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java > {code} > I will implement my own ODataJPAProcessor to workaround > {code} > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)\n\tat > org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat > > org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat > > de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat > org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat > org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat > > de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat > java.lang.reflect.Method.invoke(Method.java:498)\n\tat > org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > >
[jira] [Commented] (OLINGO-882) Olingo closes EntityManager which is managed by the application server
[ https://issues.apache.org/jira/browse/OLINGO-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15258816#comment-15258816 ] Manuel Blechschmidt commented on OLINGO-882: Hi [~mirbo], your branch would solve this. /Manuel > Olingo closes EntityManager which is managed by the application server > -- > > Key: OLINGO-882 > URL: https://issues.apache.org/jira/browse/OLINGO-882 > Project: Olingo > Issue Type: Bug > Components: odata2-jpa >Affects Versions: V2 2.0.6 > Environment: Java 1.8, wildfly 8 >Reporter: Manuel Blechschmidt >Assignee: Michael Bolz > > Like I already mentioned in ONLINGO-754 the EntityManager is closed by > Olingo. This creates a problem if the EntityManager is managed by an > application server. > We now decomposed our application and are consuming olingo through a > transitive dependency. Therefore our dirty hack by "overwritten" classes by > putting them in our own codebase does not work anymore. > The problem is here: > {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} > https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java > {code} > I will implement my own ODataJPAProcessor to workaround > {code} > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)\n\tat > org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat > > org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat > > de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat > org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat > org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat > > de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat > java.lang.reflect.Method.invoke(Method.java:498)\n\tat > org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > >
[jira] [Commented] (OLINGO-882) Olingo closes EntityManager which is managed by the application server
[ https://issues.apache.org/jira/browse/OLINGO-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15258807#comment-15258807 ] Manuel Blechschmidt commented on OLINGO-882: I will check this . > Olingo closes EntityManager which is managed by the application server > -- > > Key: OLINGO-882 > URL: https://issues.apache.org/jira/browse/OLINGO-882 > Project: Olingo > Issue Type: Bug > Components: odata2-jpa >Affects Versions: V2 2.0.6 > Environment: Java 1.8, wildfly 8 >Reporter: Manuel Blechschmidt >Assignee: Michael Bolz > > Like I already mentioned in ONLINGO-754 the EntityManager is closed by > Olingo. This creates a problem if the EntityManager is managed by an > application server. > We now decomposed our application and are consuming olingo through a > transitive dependency. Therefore our dirty hack by "overwritten" classes by > putting them in our own codebase does not work anymore. > The problem is here: > {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} > https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java > {code} > I will implement my own ODataJPAProcessor to workaround > {code} > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)\n\tat > org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat > > org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat > > de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat > org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat > org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat > > de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat > java.lang.reflect.Method.invoke(Method.java:498)\n\tat > org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > >
[jira] [Commented] (OLINGO-882) Olingo closes EntityManager which is managed by the application server
[ https://issues.apache.org/jira/browse/OLINGO-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15238692#comment-15238692 ] Manuel Blechschmidt commented on OLINGO-882: Hi Michael, I think that Chandan solution does not prevent the entity manager to get closed. I have to double check this. Thanks a lot Manuel > Olingo closes EntityManager which is managed by the application server > -- > > Key: OLINGO-882 > URL: https://issues.apache.org/jira/browse/OLINGO-882 > Project: Olingo > Issue Type: Bug > Components: odata2-jpa >Affects Versions: V2 2.0.6 > Environment: Java 1.8, wildfly 8 >Reporter: Manuel Blechschmidt >Assignee: Michael Bolz > > Like I already mentioned in ONLINGO-754 the EntityManager is closed by > Olingo. This creates a problem if the EntityManager is managed by an > application server. > We now decomposed our application and are consuming olingo through a > transitive dependency. Therefore our dirty hack by "overwritten" classes by > putting them in our own codebase does not work anymore. > The problem is here: > {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} > https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java > {code} > I will implement my own ODataJPAProcessor to workaround > {code} > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)\n\tat > org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat > > org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat > > de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat > org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat > org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat > > de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat > java.lang.reflect.Method.invoke(Method.java:498)\n\tat > org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)\n\tat > >
[jira] [Commented] (OLINGO-882) Olingo closes EntityManager which is managed by the application server
[ https://issues.apache.org/jira/browse/OLINGO-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15235148#comment-15235148 ] Chandan V.A commented on OLINGO-882: Hi Manuel, To support JTA based transactions the interface org.apache.olingo.odata2.jpa.processor.api.ODataJPATransaction has to be implemented by applications and registered as a callback in the Serivce factory (similar to error callback registration). If application specific implementation is found by JPA processor library then the library will not attempt to commit/rollback the transaction ensuring that the entity manager is not closed leaving that decision to applications. I hope this solves your use case. Thanks Kind Regards Chandan > Olingo closes EntityManager which is managed by the application server > -- > > Key: OLINGO-882 > URL: https://issues.apache.org/jira/browse/OLINGO-882 > Project: Olingo > Issue Type: Bug > Components: odata2-jpa >Affects Versions: V2 2.0.6 > Environment: Java 1.8, wildfly 8 >Reporter: Manuel Blechschmidt >Assignee: Michael Bolz > > Like I already mentioned in ONLINGO-754 the EntityManager is closed by > Olingo. This creates a problem if the EntityManager is managed by an > application server. > We now decomposed our application and are consuming olingo through a > transitive dependency. Therefore our dirty hack by "overwritten" classes by > putting them in our own codebase does not work anymore. > The problem is here: > {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} > https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java > {code} > I will implement my own ODataJPAProcessor to workaround > {code} > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)\n\tat > org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat > > org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat > > de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat > org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat > org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat > > de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat > java.lang.reflect.Method.invoke(Method.java:498)\n\tat > org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > >
[jira] [Commented] (OLINGO-882) Olingo closes EntityManager which is managed by the application server
[ https://issues.apache.org/jira/browse/OLINGO-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15235124#comment-15235124 ] Manuel Blechschmidt commented on OLINGO-882: Hi [~mirbo] , this would help us but it would be even better if olingo could check for itself if it is a JTA transaction and only close the entity manager if it is not: {code} public void close(boolean forceClose) { ODataJPATombstoneContext.cleanup(); EntityManager em = oDataJPAContext.getEntityManager(); try { if (!oDataJPAContext.getODataContext().isInBatchMode() || forceClose) { if (em.isOpen() && em.getTransaction () != null) { em.close(); } } } catch (IllegalStateException ex) { // JTA managed, do nothing ... } } {code} http://stackoverflow.com/questions/8010083/how-do-i-tell-if-my-entitymanager-is-using-jta-or-resource-local-datasource > Olingo closes EntityManager which is managed by the application server > -- > > Key: OLINGO-882 > URL: https://issues.apache.org/jira/browse/OLINGO-882 > Project: Olingo > Issue Type: Bug > Components: odata2-jpa >Affects Versions: V2 2.0.6 > Environment: Java 1.8, wildfly 8 >Reporter: Manuel Blechschmidt >Assignee: Michael Bolz > > Like I already mentioned in ONLINGO-754 the EntityManager is closed by > Olingo. This creates a problem if the EntityManager is managed by an > application server. > We now decomposed our application and are consuming olingo through a > transitive dependency. Therefore our dirty hack by "overwritten" classes by > putting them in our own codebase does not work anymore. > The problem is here: > {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} > https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java > {code} > I will implement my own ODataJPAProcessor to workaround > {code} > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)\n\tat > org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat > > org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat > > de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat > org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat > org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat > > de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat > java.lang.reflect.Method.invoke(Method.java:498)\n\tat > org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > >
[jira] [Commented] (OLINGO-882) Olingo closes EntityManager which is managed by the application server
[ https://issues.apache.org/jira/browse/OLINGO-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15234555#comment-15234555 ] Michael Bolz commented on OLINGO-882: - Hi [~manuel_b], have you take a look at the suggested solution? Best Regards, Michael > Olingo closes EntityManager which is managed by the application server > -- > > Key: OLINGO-882 > URL: https://issues.apache.org/jira/browse/OLINGO-882 > Project: Olingo > Issue Type: Bug > Components: odata2-jpa >Affects Versions: V2 2.0.6 > Environment: Java 1.8, wildfly 8 >Reporter: Manuel Blechschmidt >Assignee: Michael Bolz > > Like I already mentioned in ONLINGO-754 the EntityManager is closed by > Olingo. This creates a problem if the EntityManager is managed by an > application server. > We now decomposed our application and are consuming olingo through a > transitive dependency. Therefore our dirty hack by "overwritten" classes by > putting them in our own codebase does not work anymore. > The problem is here: > {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} > https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java > {code} > I will implement my own ODataJPAProcessor to workaround > {code} > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)\n\tat > org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat > > org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat > > de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat > org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat > org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat > > de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat > java.lang.reflect.Method.invoke(Method.java:498)\n\tat > org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > >
[jira] [Commented] (OLINGO-882) Olingo closes EntityManager which is managed by the application server
[ https://issues.apache.org/jira/browse/OLINGO-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15152084#comment-15152084 ] Manuel Blechschmidt commented on OLINGO-882: [~mirbo] I will look into it. > Olingo closes EntityManager which is managed by the application server > -- > > Key: OLINGO-882 > URL: https://issues.apache.org/jira/browse/OLINGO-882 > Project: Olingo > Issue Type: Bug > Components: odata2-jpa >Affects Versions: V2 2.0.6 > Environment: Java 1.8, wildfly 8 >Reporter: Manuel Blechschmidt >Assignee: Michael Bolz > > Like I already mentioned in ONLINGO-754 the EntityManager is closed by > Olingo. This creates a problem if the EntityManager is managed by an > application server. > We now decomposed our application and are consuming olingo through a > transitive dependency. Therefore our dirty hack by "overwritten" classes by > putting them in our own codebase does not work anymore. > The problem is here: > {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} > https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java > {code} > I will implement my own ODataJPAProcessor to workaround > {code} > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)\n\tat > org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat > > org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat > > de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat > org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat > org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat > > de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat > java.lang.reflect.Method.invoke(Method.java:498)\n\tat > org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > >
[jira] [Commented] (OLINGO-882) Olingo closes EntityManager which is managed by the application server
[ https://issues.apache.org/jira/browse/OLINGO-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15145815#comment-15145815 ] Michael Bolz commented on OLINGO-882: - Hi [~manuel_b], IMHO the should be a option provided to set a /container managed persistence/ mode so that the default close of the entity manager is not done by the JPA extension. To check if this fit for your use case and do not break anything I created the feature branch [OLINGO-882_EnableContainerManagedPersistence|https://git1-us-west.apache.org/repos/asf?p=olingo-odata2.git;a=shortlog;h=refs/heads/OLINGO-882_EnableContainerManagedPersistence] and make [this commit|https://git1-us-west.apache.org/repos/asf?p=olingo-odata2.git;a=commit;h=185e97f2854a52fd0f1e7cb6ddb12d21c7aa65a6]. Can you please check and give feedback. Best Regards, Michael > Olingo closes EntityManager which is managed by the application server > -- > > Key: OLINGO-882 > URL: https://issues.apache.org/jira/browse/OLINGO-882 > Project: Olingo > Issue Type: Bug > Components: odata2-jpa >Affects Versions: V2 2.0.6 > Environment: Java 1.8, wildfly 8 >Reporter: Manuel Blechschmidt >Assignee: Michael Bolz > > Like I already mentioned in ONLINGO-754 the EntityManager is closed by > Olingo. This creates a problem if the EntityManager is managed by an > application server. > We now decomposed our application and are consuming olingo through a > transitive dependency. Therefore our dirty hack by "overwritten" classes by > putting them in our own codebase does not work anymore. > The problem is here: > {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} > https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java > {code} > I will implement my own ODataJPAProcessor to workaround > {code} > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: > JBAS011424: Container managed entity manager can only be closed by the > container (auto-cleared at tx/invocation end and closed when owning component > is closed.)\n\tat > org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat > > org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat > > de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat > org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat > org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat > > org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat > > de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat > java.lang.reflect.Method.invoke(Method.java:498)\n\tat > org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)\n\tat > > org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)\n\tat > > org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat > > org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat > > org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat > >