Transaction
pentaho.type.changes. Transaction
A Transaction
object stores information about changes performed to instances
.
When a transaction is the ambient transaction, it stores the changes performed to any instances. All of the changes performed are temporary and no change events are emitted, until the transaction is committed.
The ambient transaction is accessible through Transaction.current
.
All of the changes are immediately visible, through any read operations of the modified instances, while the transaction is the ambient transaction.
If a transaction ceases to be the ambient transaction, then all of the changes that it captured suddenly become inaccessible.
If a transaction is later committed, and is successful, every change becomes permanent. Otherwise, if the transaction is simply disposed of, all the changes it captured are lost.
Managing the ambient transaction is best handled implicitly, by delegating to a TransactionScope
object.
AMD Module
require(["pentaho/type/Transaction"], function(Transaction) { /* code goes here */ });
Implements
Constructor
Name | Description |
---|---|
new Transaction() | Creates a |
Members
Name | Description |
---|---|
current : Static | Gets the ambient transaction, if any, or |
isCurrent : | Gets a value that indicates if this transaction is the |
isProposed : | Gets a value that indicates if the transaction is in a proposed state, that is, it has not been committed or rejected. |
isReadOnly : | Gets a value that indicates if the transaction is in a read-only state. |
result : | Gets an action result of the final state of the transaction; or |
version : | Gets the current transaction version. |
Methods
Name | Description |
---|---|
enter() : pentaho.type.changes.TransactionScope Static | Enters a scope of change. |
enterCommitted() : pentaho.type.changes.CommittedScope Static | Enters a read-committed scope. |
getChangesetsPending(container) : Array.< Static | Gets any changesets still being delivered through notifications in the commit phase of transactions. |
ensureChangeset(owner) : pentaho.type.changes.Changeset | Called to obtain a changeset for a given container in this transaction. |
enter() : pentaho.type.changes.TransactionScope | Enters the transaction and returns a new transaction scope to control the transaction. |
getAmbientReferences(container) : pentaho.type.ReferenceList | Gets the ambient references of a given container, if any. |
getChangeset(uid) : pentaho.type.changes.Changeset | Gets the changeset of an instance, given its unique identifier. |
Constructor Details
new Transaction() |
---|
Creates a Source: javascript/web/pentaho/type/changes/Transaction.js, line 85 |
Members Details
current: Static |
---|
Gets the ambient transaction, if any, or Source: javascript/web/pentaho/type/changes/Transaction.js, line 955 |
isCurrent: |
---|
Gets a value that indicates if this transaction is the Source: javascript/web/pentaho/type/changes/Transaction.js, line 368 |
isProposed: |
---|
Gets a value that indicates if the transaction is in a proposed state, that is, it has not been committed or rejected. Source: javascript/web/pentaho/type/changes/Transaction.js, line 196 See also: pentaho.type.changes.Transaction#result |
isReadOnly: |
---|
Gets a value that indicates if the transaction is in a read-only state. A transaction becomes read-only when it is previewed, committed or rejected. Source: javascript/web/pentaho/type/changes/Transaction.js, line 208 |
result: |
---|
Gets an action result of the final state of the transaction; or Source: javascript/web/pentaho/type/changes/Transaction.js, line 221 |
version: |
---|
Gets the current transaction version. Beware, this version number is not the same as that of Initially, a transaction has version Source: javascript/web/pentaho/type/changes/Transaction.js, line 182 |
Methods Details
enter() : pentaho.type.changes.TransactionScope Static | ||||
---|---|---|---|---|
Enters a scope of change. To mark the changes in the scope as error, call its To end the scope of change successfully, dispose the returned transaction scope, by calling its If the scope initiated a transaction, then that transaction is committed. Otherwise, if an ambient transaction already existed when the change scope was created, that transaction is left uncommitted. To end the scope with an error, call its Source: javascript/web/pentaho/type/changes/Transaction.js, line 980
|
enterCommitted() : pentaho.type.changes.CommittedScope Static | ||||
---|---|---|---|---|
Enters a read-committed scope. Within this scope there is no current transaction and reading the properties of instances obtains their committed values. Source: javascript/web/pentaho/type/changes/Transaction.js, line 993
|
getChangesetsPending(container) : Array.< Static | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets any changesets still being delivered through notifications in the commit phase of transactions. If a transaction is started and committed from within the Source: javascript/web/pentaho/type/changes/Transaction.js, line 1009
|
ensureChangeset(owner) : pentaho.type.changes.Changeset | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Called to obtain a changeset for a given container in this transaction. Source: javascript/web/pentaho/type/changes/Transaction.js, line 298
See also: pentaho.type.changes.Changeset#__onChildChangesetCreated |
enter() : pentaho.type.changes.TransactionScope | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Enters the transaction and returns a new transaction scope to control the transaction. Source: javascript/web/pentaho/type/changes/Transaction.js, line 382
|
getAmbientReferences(container) : pentaho.type.ReferenceList | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets the ambient references of a given container, if any. Source: javascript/web/pentaho/type/changes/Transaction.js, line 281
|
getChangeset(uid) : pentaho.type.changes.Changeset | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets the changeset of an instance, given its unique identifier. If no changeset has been added for the specified instance, Source: javascript/web/pentaho/type/changes/Transaction.js, line 236
|