Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

CommittedScope

pentaho.type.changes.CommittedScope

The CommittedScope class provides a way for a certain region of code to read the committed values of instances.

Extends

Constructor

Name Description
new CommittedScope(context)

Creates a CommittedScope.

Members

Name Description
context : pentaho.type.Context

Gets the associated context.

isCurrent : boolean

Gets a value that indicates if this scope is the current scope of its context.

isInside : boolean

Gets a value that indicates if this scope has not been exited.

transaction : pentaho.type.changes.Transaction

Gets the associated transaction, if any, or null.

Methods

Name Description
_assertInsideAndCurrent()
 
Protected

Throws an error if the scope has been exited from or is not the current scope.

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.

using(fun, ctx) : any

Calls a given function within the scope and safely exits from the scope.

Constructor Details

new CommittedScope(context)

Creates a CommittedScope.

Source: javascript/web/pentaho/type/changes/CommittedScope.js, line 37

Parameters:
Name Default Value Summary
context : pentaho.type.Context

The associated context.

Members Details

context: pentaho.type.Context

Gets the associated context.

Source: javascript/web/pentaho/type/changes/AbstractTransactionScope.js, line 51

Inherited From: pentaho.type.changes.AbstractTransactionScope#context

isCurrent: boolean

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

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

transaction: pentaho.type.changes.Transaction

Gets the associated transaction, if any, or null.

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

Throws:
Name Description
pentaho.lang.OperationInvalidError

When the scope has been exited from or it is not the current scope of its context.

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 exit with keyArgs.sloppy with value true.

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 context and transaction remain available for reading.

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 keyArgs.sloppy is true.

Source: javascript/web/pentaho/type/changes/AbstractTransactionScope.js, line 194

Inherited From: pentaho.type.changes.AbstractTransactionScope#exit

Parameters:
Name Default Value Summary
keyArgs : Object
 
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
sloppy : boolean
 
Optional

Indicates that no warning should be logged if this method is called when the scope has already been exited from or is not the current scope.

Returns:
Name Description
pentaho.type.changes.AbstractTransactionScope

This scope.

using(fun, ctx) : any

Calls a given function within the scope and safely exits from the scope.

Source: javascript/web/pentaho/type/changes/AbstractTransactionScope.js, line 166

Inherited From: pentaho.type.changes.AbstractTransactionScope#using

Parameters:
Name Default Value Summary
fun : function

The function to call within the scope. The function is called with the this context specified in argument ctx. The return value of fun is returned back from this method.

ctx : Object
 
Optional

The this context in which to call fun. When unspecified, the function will have a null this.

Returns:
Name Description
any

The value returned by fun.

Throws:
Name Description
Error

Any error thrown from within fun.