Database.createScope

New in package 166

Syntax

var scope = Database.createScope();
...
scope.close();

Methods

Method Description
close() Closes scope.

Description

Creates 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:

See also

Database, Database.scope, Database.transaction, [Database.beginTransaction]

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.