TransactionScope
pentaho.type.changes.TransactionScope
The TransactionScope
class manages a transaction
.
Extends
Constructor
Name | Description |
---|---|
new TransactionScope(context, transaction) | Creates a |
Members
Name | Description |
---|---|
canCommit : | Gets a value that indicates if this scope can commit the ambient transaction. |
context : | Gets the associated context. |
isCurrent : | Gets a value that indicates if this scope is the current scope of its context. |
isInside : | Gets a value that indicates if this scope has not been exited. |
isRoot : | Indicates if this scope is the ambient transaction's root/outermost scope. |
transaction : | Gets the associated transaction, if any, or |
Methods
Name | Description |
---|---|
_assertInsideAndCurrent() Protected | Throws an error if the scope has been exited from or is not the current scope. |
accept() : pentaho.type.changes.AbstractTransactionScope | Accepts the scope. |
acceptWill() : pentaho.lang.ActionResult | Previews the result of committing the transaction by performing its will phase. |
dispose() | Exits the scope, without any warnings in case it is not inside or is not the current scope. |
exit(keyArgs) : pentaho.type.changes.AbstractTransactionScope | Exits the scope. |
reject(reason) | Rejects the associated transaction, exits the scope and throws an error containing the provided rejected reason. |
using(fun, ctx) : any | Calls a given function within the scope and safely rejects the scope in the case where an error occurs and exits the scope otherwise. |
Constructor Details
new TransactionScope(context, transaction) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Creates a Source: javascript/web/pentaho/type/changes/TransactionScope.js, line 24
|
Members Details
canCommit: |
---|
Gets a value that indicates if this scope can commit the ambient transaction. A scope can commit its transaction if:
Source: javascript/web/pentaho/type/changes/TransactionScope.js, line 51 |
context: |
---|
Gets the associated context. Source: javascript/web/pentaho/type/changes/AbstractTransactionScope.js, line 51 Inherited From: pentaho.type.changes.AbstractTransactionScope#context |
isCurrent: |
---|
Gets a value that indicates if this scope is the current scope of its context. A context's current scope is its innermost scope. Source: javascript/web/pentaho/type/changes/AbstractTransactionScope.js, line 148 Inherited From: pentaho.type.changes.AbstractTransactionScope#isCurrent |
isInside: |
---|
Gets a value that indicates if this scope has not been exited. Source: javascript/web/pentaho/type/changes/AbstractTransactionScope.js, line 136 Inherited From: pentaho.type.changes.AbstractTransactionScope#isInside |
isRoot: |
---|
Indicates if this scope is the ambient transaction's root/outermost scope. Source: javascript/web/pentaho/type/changes/AbstractTransactionScope.js, line 71 |
transaction: |
---|
Gets the associated transaction, if any, or Source: javascript/web/pentaho/type/changes/AbstractTransactionScope.js, line 61 Inherited From: pentaho.type.changes.AbstractTransactionScope#transaction |
Methods Details
_assertInsideAndCurrent() Protected | ||||
---|---|---|---|---|
Throws an error if the scope has been exited from or is not the current scope. Source: javascript/web/pentaho/type/changes/AbstractTransactionScope.js, line 103 Inherited From: pentaho.type.changes.AbstractTransactionScope#_assertInsideAndCurrent
|
accept() : pentaho.type.changes.AbstractTransactionScope | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Accepts the scope. When the scope can commit its transaction, as determined by Otherwise, if the scope cannot commit its transaction, accepting the scope simply exits from it. Source: javascript/web/pentaho/type/changes/TransactionScope.js, line 95
|
acceptWill() : pentaho.lang.ActionResult | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Previews the result of committing the transaction by performing its will phase. Call this method to determine if an operation would be valid when there's no a priori intention of committing it, in case it is valid. If the previewing returns a fulfilled result, the transaction can still be committed later, if desired. In any case, no more changes can be performed in this transaction, after Source: javascript/web/pentaho/type/changes/TransactionScope.js, line 73
|
dispose() |
---|
Exits the scope, without any warnings in case it is not inside or is not the current scope. This method is equivalent to calling Source: javascript/web/pentaho/type/changes/AbstractTransactionScope.js, line 238 Inherited From: pentaho.type.changes.AbstractTransactionScope#dispose |
exit(keyArgs) : pentaho.type.changes.AbstractTransactionScope | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Exits the scope. After this operation, the scope cannot be operated on anymore. However, properties like If this method is called and the the scope has already been exited from, or is not the current scope, a warning is logged, unless Source: javascript/web/pentaho/type/changes/AbstractTransactionScope.js, line 194 Inherited From: pentaho.type.changes.AbstractTransactionScope#exit
|
reject(reason) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Rejects the associated transaction, exits the scope and throws an error containing the provided rejected reason. Source: javascript/web/pentaho/type/changes/TransactionScope.js, line 118
|
using(fun, ctx) : any | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Calls a given function within the scope and safely rejects the scope in the case where an error occurs and exits the scope otherwise. If the transaction has been rejected somehow, its rejection error is thrown back to the caller. In any case, the scope will have been exited from when this method returns. Source: javascript/web/pentaho/type/changes/TransactionScope.js, line 144 Overrides: pentaho.type.changes.AbstractTransactionScope#using
|