New in package 166
Syntax
Database.scope( function scopeFunction() {
...
} );
Parameters
Parameter | Description |
---|---|
scopeFunction | A callback function to execute in a separate scope. |
Description
Executes the specified scopeFunction callback in a separate scope.
Objects loaded within the scope do not have changes made to the objects in other scopes. Any changes to the objects loaded or added within scopeFunction callback are discarded.
Database entities from other scopes cannot be added to Database repositories within scopeFunction callback.
Examples
Loading an object in a separate scope: