new ConnectionManagerBase()
Creates a new connection manager object.
Methods
-
<virtual> beginTransaction(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 Description dataSource
string The name of the data source.
callback
external.cbConnectionManager The callback function (for asynchronous models).
Returns:
The new connection with initiated transaction (for synchronous models).
- Type
- object
-
<virtual> commitTransaction(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 Description dataSource
string The name of the data source.
connection
object The connection to be closed.
callback
external.cbConnectionManager The callback function (for asynchronous models).
Returns:
The closed connection (for synchronous models).
- Type
- object
-
<virtual> openConnection(dataSource, callback) → {object}
-
Returns a new connection of the named data source.
Parameters:
Name Type Description dataSource
string The name of the data source.
callback
external.cbConnectionManager The callback function (for asynchronous models).
Returns:
The new connection (for synchronous models).
- Type
- object
-
<virtual> openConnection(dataSource, connection, callback) → {object}
-
Closes the given connection of the data source.
Parameters:
Name Type Description dataSource
string The name of the data source.
connection
object The connection to be closed.
callback
external.cbConnectionManager The callback function (for asynchronous models).
Returns:
The closed connection (for synchronous models).
- Type
- object
-
<virtual> rollbackTransaction(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 Description dataSource
string The name of the data source.
connection
object The connection to be closed.
callback
external.cbConnectionManager The callback function (for asynchronous models).
Returns:
The closed connection (for synchronous models).
- Type
- object