Skip to content

More robust Singleton form constraint checking #6902

@ebruchez

Description

@ebruchez

We'd like more robust singleton checking at the database label in order to ensure atomicity. The function would be:

Create new form data with this document id if there is no existing form data yet for this app/form/version, given optional username/group permissions.

Checking this requires:

  • performing operations in a single database transaction
  • searching for existing data, including checking for username/group permissions if needed
  • create new data
  • return whether this succeeded

This would be enabled for a REST PUT by passing a new parameter to the call.

One issue is that the persistence proxy is not transaction-aware (it doesn't have a transaction manager, and doesn't know about persistence providers are relational or not.

The simplest way might be to do this in the provider implementation:

  • support an extra parameter
  • in that case, perform the very limited search
    • it's in the same orbeon_form_data table
    • only extra WHERE would be for username/group permission checking

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions