You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Santosh kumar (JIRA)" <ji...@apache.org> on 2016/06/10 10:15:21 UTC

[jira] [Commented] (OLINGO-580) Support JTA based transactions in JPA processor

    [ https://issues.apache.org/jira/browse/OLINGO-580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15324177#comment-15324177 ] 

Santosh kumar commented on OLINGO-580:
--------------------------------------

I tried above steps mentioned by Chandan. I'm getting  the exception -java.lang.NullPointerException: while trying to invoke the method javax.persistence.EntityManagerFactory.getMetamodel() of a null object returned from org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext.getEntityManagerFactory()
               at org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmBaseViewImpl.<init>(JPAEdmBaseViewImpl.java:50)
               at org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmModel.<init>(JPAEdmModel.java:39)
               at org.apache.olingo.odata2.jpa.processor.core.factory.ODataJPAFactoryImpl$JPAAccessFactoryImpl.getJPAEdmModelView(ODataJPAFactoryImpl.java:219)
               at org.apache.olingo.odata2.jpa.processor.core.edm.ODataJPAEdmProvider.<init>(ODataJPAEdmProvider.java:74)
               at org.apache.olingo.odata2.jpa.processor.core.factory.ODataJPAFactoryImpl$ODataJPAAccessFactoryImpl.createJPAEdmProvider(ODataJPAFactoryImpl.java:181)
               at com.sap.suite.arch.odata.v2.CustomODataJPAServiceFactory.createService(CustomODataJPAServiceFactory.java:85)
               at org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:155)

Though I have enabled JTA in persistence.xml and have set EntityManager in the oDataJPAContext object of ODataJPAServiceFactory class of Olingo library when I try running the application, I still see part of Olingo code looks for EMF instead of EM. 

I believe this is an issue in Olingo code.i.e. when JTA is configured  and oDataJPAContext has EM object set, the Olingo code shouldn't check again for EMF initialization. 

Can somebody help  ?? 

Thanks,
Santosh

> Support JTA based transactions in JPA processor
> -----------------------------------------------
>
>                 Key: OLINGO-580
>                 URL: https://issues.apache.org/jira/browse/OLINGO-580
>             Project: Olingo
>          Issue Type: New Feature
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.3
>            Reporter: Chandan V.A
>            Assignee: Chandan V.A
>             Fix For: V2 2.0.4
>
>         Attachments: OLINGO-580.diff
>
>
> Olingo V2 JPA processor supports RESOURCE_LOCAL based transaction. Enhance the processor to support JTA based transactions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)