When you are ready to send your set of changes to the database you need to call the commit method on the transaction object. This must be done from a Server API for reasons mentioned above.
The commit function is split into sections:
-
Invoke deferred Process methods
-
Invoke deferred Processed methods
-
Invoke deferred Cancel methods (normally validation)
-
Write changes to the database and release any locks
-
Invoke post commit methods
-
Synchronize other SmartPlant Foundation sites
The transaction contains a number of objects. It will loop around each object and call in turn the deferred process methods for each object. Then it will call the processed methods for each object and so on for cancel methods.
This ensures that all the validation is done just before the commit to the database.