Class

DBLock

DBLock(db, timeout)

Constructor

# new DBLock(db, timeout)

Parameters:
Name Type Description
db *

DSU Database implementation

timeout number

timeout for scheduling operations in ms. defaults to 10ms

View Source managers/DBLock.js, line 19

Methods

# allow(tableName, manager)

Allows a different manager to act in the current transaction

.

Allows a different manager to act in the current transaction

Parameters:
Name Type Description
tableName string
manager Manager

View Source managers/DBLock.js, line 47

# beginBatch(tableName)

Begins or continues a db batch operation depending if there's one in progress or not

.

Begins or continues a db batch operation depending if there's one in progress or not

Parameters:
Name Type Description
tableName string

View Source managers/DBLock.js, line 73

error when a batch operation is already in progress

Error

# cancelBatch(tableName, callback)

Cancels the batch operation in progress

.

Cancels the batch operation in progress

Parameters:
Name Type Description
tableName string
callback function

View Source managers/DBLock.js, line 151

# commitBatch(tableName, forceopt, callback)

Commits or continues a db batch operation depending if the operation counter has run out

.

Commits or continues a db batch operation depending if the operation counter has run out

Parameters:
Name Type Attributes Description
tableName string
force boolean <optional>

when true forces the commit regardless of the counter. defaults to false

callback function

View Source managers/DBLock.js, line 111

# disallow(tableName, manager)

Disallows a different manager to act in the current transaction

.

Disallows a different manager to act in the current transaction

Parameters:
Name Type Description
tableName string
manager Manager

View Source managers/DBLock.js, line 60

# isLocked(tableName) → {boolean}

Parameters:
Name Type Description
tableName string

View Source managers/DBLock.js, line 29

the DB Status regarding that table

boolean

# schedule(method)

Schedules a method call for after the current db operation has benn finished

.

Schedules a method call for after the current db operation has benn finished

Parameters:
Name Type Description
method function

View Source managers/DBLock.js, line 37