class staticbo.dataAccess. ConnectionManagerBase
Source: data-access/
Serves as the base class to manage connections of several data sources.
new ConnectionManagerBase()
Creates a new connection manager object.
Methods
abstractbeginTransaction(dataSource, callback) → object
Returns a new connection of the named data source after having started a new transaction. If the data source does not support transactions, returns a new connection only.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
dataSource |
string |
|
The name of the data source. |
callback |
|
The callback function (for asynchronous models). |
- Returns
-
object
The new connection with initiated transaction (for synchronous models).
abstractcommitTransaction(dataSource, connection, callback) → object
Finalizes the current transaction and closes the connection of the data source. If the data source does not support transactions, closes the given connection only.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
dataSource |
string |
|
The name of the data source. |
connection |
object |
|
The connection to be closed. |
callback |
|
The callback function (for asynchronous models). |
- Returns
-
object
The closed connection (for synchronous models).
abstractopenConnection(dataSource, connection, callback) → object
Closes the given connection of the data source.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
dataSource |
string |
|
The name of the data source. |
connection |
object |
|
The connection to be closed. |
callback |
|
The callback function (for asynchronous models). |
- Returns
-
object
The closed connection (for synchronous models).
abstractopenConnection(dataSource, callback) → object
Returns a new connection of the named data source.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
dataSource |
string |
|
The name of the data source. |
callback |
|
The callback function (for asynchronous models). |
- Returns
-
object
The new connection (for synchronous models).
abstractrollbackTransaction(dataSource, connection, callback) → object
Cancels the current transaction and closes the connection of the data source. If the data source does not support transactions, closes the given connection only.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
dataSource |
string |
|
The name of the data source. |
connection |
object |
|
The connection to be closed. |
callback |
|
The callback function (for asynchronous models). |
- Returns
-
object
The closed connection (for synchronous models).