[
https://issues.apache.org/jira/browse/OLINGO-580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14358322#comment-14358322
]
Chandan V.A commented on OLINGO-580:
------------------------------------
Following section explains the steps that needs to done for enabling OData JPA
Processor from not handling the transactions on its own, rather rely on the
Application/Container to handle the Transaction. OData JPA processor however
will default to *_RESOURCE_LOCAL_* based transactions when following steps are
not done.
1) Application that require transaction other than RESOURCE_LOCAL needs to
implement the interface
*_org.apache.olingo.odata2.jpa.processor.api.ODataJPATransaction_*.
2) The implementation needs to be registered with the OData service factory by
overriding the method *_setODataJPATransaction_*. The method is part of
Abstract class
*_org.apache.olingo.odata2.jpa.processor.api.ODataJPAServiceFactory_*.
3) Applications that does not inherit from ODataJPAServiceFactory but would
like to use the JPA Processor features, can register the implementation of
ODataJPATransaction as an *_ODataCallback_*. Implement the method
*_getCallback_* of abstract class
*_org.apache.olingo.odata2.api.ODataServiceFactory_*.
Olingo JPA Processor for all modifying calls does the following
1) Tries to get ODataJPATransaction managed by application. If there is no
implementation found for ODataJPATransaction by application, it defaults to
ODataJPATransactionLocalDefault.
2) If the transaction is active, Olingo JPA Processor will not
begin/commit/rollback the transaction. If the transaction is not active then
Olingo JPA Processor will begin/commit/rollback the transactions.
Applications can choose to manage the transaction scope by beginning the
transaction by invoking the method *_begin_* on ODataJPATransaction and close
the transaction by *_commit_* or *_rollback_*.
> 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)