Björn Wagner created OLINGO-458:
-----------------------------------

             Summary: JPA Batch requests are not executed in a single database 
transaction
                 Key: OLINGO-458
                 URL: https://issues.apache.org/jira/browse/OLINGO-458
             Project: Olingo
          Issue Type: Bug
          Components: odata2-jpa
    Affects Versions: V2 2.0.0
            Reporter: Björn Wagner


Each single request contained in a change set of a batch is executed in its own 
database transaction. Wouldn't it make more sense to run all requests of a 
batch in a single transaction? Thereby, in case one write operation fails all 
the others are rolled back as well. Otherwise, the data might end up in an 
inconsistent state.

I had a look at the code of the 
org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImpl and 
found that the following methods just start database transactions on its own 
not matter if executed in batch or not:

private Object processCreate(final PostUriInfo createView, final InputStream 
content,  final Map<String, Object> properties,  final String 
requestedContentType)
public <T> Object processUpdate(PutMergePatchUriInfo updateView, final 
InputStream content, final Map<String, Object> properties, final String 
requestContentType)
public Object process(DeleteUriInfo uriParserResultView, final String 
contentType)





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

Reply via email to