Class: ConnectionManagerBase

bo.dataAccess. ConnectionManagerBase

Serves as the base class to manage connections of several data sources.

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
If you find bugs or have feature requests, please let us know.

JavaScript business objects ♦ Copyright © 2014-2016 Logikum, Ltd.
Documentation generated by JSDoc 3.2.2 on 2015. December 31. using the DocStrap template.