Set a callback to be executed after all the operations in the transaction were executed successfully
callback: (success: boolean, message?: string) => void
the callback to be executed
Create a new instance.
A custom map can specify property values for the instance.
A source can be the orchestrator (‘server’), local (‘self’) or an external data source (tag of DBConnector). The source is where the object is persisted and its true value outside local scopes.
tag of the model of the instance to be created
optionalproperties: Map<Tag, any>
custom map from tag to their value for properties of the instance to be created
optional source of the instance
optional tag of the instance to be created and must be unique
the tag of the instance to be created
Create relation between two instances
tag of the relation to be created
tag of the ORIGIN instance of the relation
tag ofo the DESTINATION instance of the relation
this transaction with the create relation operation registered
Delete an instance
tag of the instance to be deleted
Delete any number of the relation starting from specified node.
The specified node might be the origin or (exclusive) the destination of the relation.
For the relations :
- a - [rel1] -> b,
- c - [inverseRel(rel1)] -> a,
- a - [rel1] -> d,
- a - [rel2] -> d
tx.deleteAllRelation(rel1, a)will remove the first and third relations
relation: Relation<any, any>
deleted relation, indicates relation tag and direction
Delete a relation between two specified instances.
The relation is only deleted for the relation parameter direction.
tag of the relation to be deleted
origin instance tag
destination instance tag
Execute atomically the transaction at the source
promise resolving if the transaction succeeds, rejecting if the transaction fails
Execute atomically a transaction at the source The
largemode sends the transaction over HTTP
promise resolving if the transaction succeeds, rejecting if the transaction fails.
Get the transaction id attached to this transaction
this transaction id
Add all operations of another transaction into this transaction
the other transaction to add operations from
Retrieve the tag of the model of the instance tag from the created instances in this transaction or from the local database.
the instance to find the model of
the tag of the model of the given instance
Update multiple properties of a single instance
Change the persistence mode of all instances in this transaction
whether instances are persisted outside the local datacloud
Change the persistence mode for a single instance in this transaction
the instance to be persisted
the persisting mode
Change the source of all instances created in this transaction
sourcecan be specified as :
- the orchestrator (‘server’),
- local (‘self’) or
- an external data source (Tag of a
The source of a data object is where the object is persisted.
By default, the
sourceis the default source configured in the project.
the new source for instances
Update the property of an instance
tag of the instance to be updated
the property to be updated
the value of the property to be updated to
Start a transaction using an existing transaction in the provided context or a new one if there is none.
context in which the transaction executes
Execute a given transaction if there is no open transaction in the context.
transaction to process
boolean indicating if the argument transaction has been processed
Transactions are the unique way to apply a list of operations to the datacloud. A transaction can be merged into another transaction so that both are executed as a single set of operations.
All the operations for a transaction are executed atomically. Either all operations succeed, or none is applied.
There are 5 types of basic operations :
In most cases, we apply the Transactions operations using the “execute()” method. The transaction size is limited but in real-time. It notifies observers of the data in real-time.
Larger transactions with big set of operations (batch updates) must be executed using “executeAsLarge()” method. However no notification will be generated.
Callbacks can be registered on transaction using “afterExecution()” method. They are executed once the transaction is applied.
Example of transaction:
Concurrency transactions do not guarantee their execution order.