Database transactions

Work with the database for all the actions in D2000 environment (ESL script, D2000 HI environment) is implemented by process D2000 DBManager. Execution of individual actions (SQL commands) is performed within some physical connection to the database. Several connections to one database may be created concurrently.

The existence of a connection is important during controlling the transaction access to the database. According to the mode of connection settings, the individual actions (SQL commands) are executed:

Transaction mode, in many cases, is necessary to work with the database and may be controlled by ESL facilities.

ESL defines sets of commands for accessing a database table. Each of the sets is characterized (and is limited) by the existence of the logical operation CONNECT and DISCONNECT (e.g. DB_CONNECT and DB_DISCONNECT). These operations always create an access to a database table by means of an existing Connection. If Connection is not determined during the execution of the action CONNECT, process D2000 DBManager will use so-called Automatic connection (Default connection). This works in Auto Commit mode and is shared (other CONNECT without the determination of Connect uses again the existing Automatic connection). Process D2000 DBManager will generate it automatically.

The following actions are intended to work with Connection:

Action Meaning
DB_TRANS_OPEN Create new Connection
DB_TRANS_COMMIT Execution of "COMMIT" action
DB_TRANS_ROLLBACK Execution of "ROLLBACK" action
DB_TRANS_CLOSE Execution of "ROLLBACK" action + termination of the Connection

By default, every access to database table in D2000 environment is done by means of Automatic connection, if not stated differently. This fact is represented in the following figure, where: