Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-458

JPA Batch requests are not executed in a single database transaction

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • V2 2.0.0
    • V2 2.0.1
    • odata2-jpa
    • 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)

      Attachments

        Activity

          People

            chandan.v.a Chandan V.A
            bjnwagner Björn Wagner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: