Skip to content

Implement transaction support for batch requests with POST operations #88

@kbarbounakis

Description

@kbarbounakis

Background
The batch feature in OData v4 allows for complex workflows involving multiple operations within a single request. However, when multiple POST requests (inserts) are included in a batch, it's crucial to ensure that either all operations succeed or the batch is rolled back if any fail, maintaining data integrity.

Task

  • Design and implement transaction handling for batch requests containing POST operations.
  • Ensure that if any POST operation in a batch fails, all changes from that batch are rolled back to prevent partial insertions.
  • Support atomicityGroup/changeset semantics according to OData v4 standards.
  • Handle errors correctly (e.g., 424 Failed Dependency when dependencies exist and a parent operation fails).
  • Provide appropriate feedback in the batch response for transaction outcomes.

Acceptance Criteria

  • POST requests in a batch are executed in an atomic transaction group.
  • On failure of one or more POSTs, all requests in the group are rolled back.
  • Tests are provided for success, failure, and rollback scenarios.
  • The feature is documented (examples, API usage, edge-cases involving nested objects or arrays).

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions