Inherited by SqlConnection, SqlGwConnection, SqlLogConnection, and SqlOdbcConnection.
Public Member Functions | |
| virtual DbRetVal | connect (char *user, char *pass)=0 |
| opens connection to the sql engine | |
| virtual DbRetVal | disconnect ()=0 |
| closes connection to the sql engine and releases all the resources | |
| virtual DbRetVal | commit ()=0 |
| Commits active transaction. | |
| virtual DbRetVal | rollback ()=0 |
| Aborts the active transaction. | |
| virtual DbRetVal | beginTrans (IsolationLevel isoLevel=READ_COMMITTED, TransSyncMode mode=OSYNC)=0 |
| Starts a new transaction. | |
It represents the database connection to the sql engine.
All database operations shall be done within the context of the connection.
Application should first create object of this class to accessing the database
through SQL Engine. Each connection has only one active transaction at any given point of time, all
operations which happen using this connection object will be done as part of that
transaction.
Note:
SERIALIZABLE isolation level is not supported.
| virtual DbRetVal AbsSqlConnection::beginTrans | ( | IsolationLevel | isoLevel = READ_COMMITTED, |
|
| TransSyncMode | mode = OSYNC | |||
| ) | [pure virtual] |
Starts a new transaction.
The previous transaction should be either committed or rollback
before beginTrans is called.
Applications are required to start transaction before they attempt any
database operation.
| isoLevel | isolation level. Default is read committed. |
| virtual DbRetVal AbsSqlConnection::commit | ( | ) | [pure virtual] |
Commits active transaction.
It makes all the changes made in the current transaction permanent and
it also releases the locks held by the current transaction.
After a transaction commits, application is required to start another
transaction for further database operations.
| virtual DbRetVal AbsSqlConnection::connect | ( | char * | user, | |
| char * | pass | |||
| ) | [pure virtual] |
opens connection to the sql engine
| user | username for authentication | |
| pass | password for authentication |
| virtual DbRetVal AbsSqlConnection::disconnect | ( | ) | [pure virtual] |
| virtual DbRetVal AbsSqlConnection::rollback | ( | ) | [pure virtual] |
Aborts the active transaction.
undo all the changes made in the current transaction and it also
releases the locks held by the current transaction.
After a transaction rollback, application is required to start another
transaction for further database operations.