Interface Procedure

All Known Subinterfaces:
ReadOnlyProcedure

public interface Procedure
This interface must be implemented in order to safely update a repository and perform imports and exports. In EBX®, a procedure is the way to implement a transaction.

The execution of a procedure has the following features:

  • Authentication
    The user is authenticated either through the EBX® user interface (see ServiceContext) or using a programmatic service (see ProgrammaticService),
  • Atomicity
    The updates performed on the repository are either all committed or all cancelled (if execution fails), unless a commit threshold has been specified.
  • Structural consistency
    Execution fails if there is a "structural" error, for instance if an object to update does not exist, a set value is not compatible with the expected type or an object is created with an erroneous identifier.
  • Validation
    Errors which are not "structural" (mainly data model facets) do not prevent the execution and the commit. These errors are handled by the validation layer. This tolerant policy allows tracking and correcting "light" errors afterwards.
  • Isolation
    The execution of a procedure prevents the concurrent execution of another procedure on the same dataspace or snapshot. However, it does not prevent concurrent reads (outside of procedures, or in a ReadOnlyProcedure). See also Concurrency and isolation levels.
  • Durability
    All the updates performed on the repository are persisted.
  • Logging
    The execution of a procedure is always logged into history. Procedure-specific information can be added.

A procedure is executed by calling one of the following methods:

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    The implementation of this method defines what this procedure actually does on the current repository.
  • Method Details

    • execute

      void execute(ProcedureContext aContext) throws Exception
      The implementation of this method defines what this procedure actually does on the current repository.
      Exception handling

      If this method throws an exception, the container properly handles it so as to preserve integrity, by cancelling the current transaction.

      Furthermore, if a ProcedureContext method raises an exception, then any preceding modifications made on the repository are first cancelled before the client code gets the exception. This additional feature ensures that the repository and cache remain consistent, even if the client code catches exceptions.

      Performance warning: in semantic mode and if the current transaction has already performed some updates, cancelling the transaction can impact general performance. For more information, see Performance guidelines.

      Transaction management and usage constraints.

      The following constraints apply:

      • A procedure can only impact one dataspace or snapshot.
      • A procedure cannot call a sub-procedure in the same dataspace or snapshot in the same thread.
      • A procedure can call a sub-procedure on any other dataspace or snapshot in the same thread. Limitation: If the main procedure fails after the sub-procedure has committed, the sub-procedure is not cancelled.
      Multi-threading

      This method is called each time one of following methods is called: ServiceContext.execute(Procedure) or ProgrammaticService.execute(Procedure). Hence, it is possible that, for a single instance of this interface, this method could be called concurrently by several threads. This depends on how the developer manages the Procedure instances in integrated or programmatic service.

      Throws:
      Exception
      See Also: