# new DBLock(db, timeout)
Parameters:
| Name | Type | Description |
|---|---|---|
db |
*
|
DSU Database implementation |
timeout |
number
|
timeout for scheduling operations in ms. defaults to 10ms |
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
|
# 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
|
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
|
# 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
|
# 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
|
# isLocked(tableName) → {boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
tableName |
string
|
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
|