Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
V2 2.0.0
-
None
Description
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)