new TransactionManager(logger, db, router, fileManager, timeout)
Parameters:
| Name | Type | Description |
|---|---|---|
logger |
olympe.logging.Channel | |
db |
olympe.dc.DBView | |
router |
olympe.dc.Router | |
fileManager |
olympe.dc.FileServiceManager | |
timeout |
number |
Members
-
<static> FINALIZE :number
-
Enumeration of the different ways to finalise a transaction.
Type:
- number
Properties:
Name Type Default Description NOTIFICATION_DONEnumber 0 NO_NOTIFICATIONnumber 1 NO_PERSISTENCEnumber 2
Methods
-
clearStack( [callback])
-
Clears the transaction stack.
Parameters:
Name Type Argument Description callbackolympe.dc.Manager.TransactionCallback <optional>
-
executeLargeTransaction(transaction [, callback])
-
Executes the specified transaction over HTTP and do not send notification. Bind the callback with the current execution context.
Parameters:
Name Type Argument Description transactionolympe.dc.Transaction callbackolympe.dc.Manager.TransactionCallback <optional>
-
executeTransaction(transaction [, callback] [, waitForNotification])
-
Executes the specified transaction over WS, sends notifications. Bind the callback with the current execution context.
Parameters:
Name Type Argument Description transactionolympe.dc.Transaction callbackolympe.dc.Manager.TransactionCallback <optional>
waitForNotificationboolean <optional>
If
true, wait for the transaction to have been notified to all clients before calling back. Iffalse, call back as soon as the transaction has been accepted. -
getLogger()
-
Return the transaction logger
Returns:
the transaction logger
- Type
- olympe.logging.Channel
-
getStack(callback)
-
Gets the transaction stack.
Parameters:
Name Type Description callbackfunction the callback receiving the list of transaction ids, the undo stack size and the redo stack size
-
<package> initBurstTransaction(transaction)
-
Initialise a burst transaction.
Parameters:
Name Type Description transactionolympe.dc.BurstTransaction Returns:
onUpdate function
-
invalidateBurstTransaction(id, rollback, errorMessage)
-
When a burst transaction is refused by a source, rollback the updates.
Parameters:
Name Type Description idstring the burst transaction id
rollbackolympe.dc.db.GraphPatch the rollback patch
errorMessagestring -
onAllTransactionDone(callback)
-
If some transactions are pending, register a callback that will be be executed when all the pending transactions will be done (fully notified). Otherwise, execute the callback.
Parameters:
Name Type Description callbackfunction -
persistTransaction(id, finalize, errorMsg)
-
When a transaction has been fully processed by the remote, it ensures the persistence of the instances created by the transaction is applied on the local database. And at that moment it allows the garbage collector to do its job.
Parameters:
Name Type Argument Description idstring the subscription id
finalizeolympe.dc.transaction.TransactionManager.FINALIZE errorMsgstring <nullable>
describe the error that occurred, null if no error.
-
redo( [callback])
-
Redoes the last undone transaction.
Parameters:
Name Type Argument Description callbackolympe.dc.Manager.TransactionCallback <optional>
-
sendBurstUpdate(transaction, updates, isCommit [, commitCallback])
-
Send the accumulated burst transaction updates to the datacloud.
Parameters:
Name Type Argument Description transactionolympe.dc.BurstTransaction updatesMap.<string, !Map.<string, *>> isCommitboolean commitCallbackolympe.dc.Manager.TransactionCallback <optional>
-
undo( [callback])
-
Undoes the last transaction (if reversible).
Parameters:
Name Type Argument Description callbackolympe.dc.Manager.TransactionCallback <optional>
Olympe SDK