Interface Procedure
- All Known Subinterfaces:
ReadOnlyProcedure
The execution of a procedure has the following features:
- Authentication
The user is authenticated either through the EBX® user interface (seeServiceContext) or using a programmatic service (seeProgrammaticService), - Atomicity
The updates performed on the repository are either all committed or all cancelled (if execution fails), unless acommit thresholdhas 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 aReadOnlyProcedure). 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-specificinformationcan be added.
A procedure is executed by calling one of the following methods:
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(ProcedureContext aContext) The implementation of this method defines what this procedure actually does on the current repository.
-
Method Details
-
execute
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
ProcedureContextmethod 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)orProgrammaticService.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 theProcedureinstances inintegratedorprogrammaticservice.- Throws:
Exception- See Also:
-