Skip to content

Missing rollback when erroring on nested Entity POST #82

Description

@SpeckiJ

When posting invalid nested Entities, e.g.

{
  "name": "thingy-thing",
  "description": "Whatever",
  "properties": {
    "uri": "https://some.url"
  },
  "Locations": [
    {
      "name": "Position",
      "description": "Thing location",
      "encodingType": "application/vnd.geo+json",
      "location": {
        "type": "Point",
        "coordinates": [
          23.094,
          42.361
        ]
      }
    }
  ],
  "Datastreams": [
    {
      "name": "Thing-stream",
      "description": "Stream description",
      "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_CategoryObservation",
      "unitOfMeasurement": {
        "name": null,
        "symbol": null,
        "definition": null
      },
      "ObservedProperty": {
        "name": "Taxon",
        "description": "The canonical name of the observed species",
        "definition": "http://some.url"
      },
      "Sensor": {
        "name": "Citizen Scientist",
        "description": "Person sharing individual observations to the public for scientific use",
        "encodingType": "text/html",
        "metadata": "https://some.url"
      }
    }
  ]
}

The STA errors out, but still persists some of the Entities (e.g. ObservedProperty) as they are already flushed to the database.

Apparently the @Rollback Annotation is not transient and a new @Rollback scope is openend when those sub-entities are persisted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingv2affects v2 (no-olingo version) of the STA

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions