Creating the Connection Pool
The Connection Pool in OO4O is a pool of OraDatabase objects. The pool is
created by invoking the CreateDatabasePool method of the OraSession interface. An OraDatabase object represents a
connection to an Oracle database and contains methods for executing SQL statements
and PL/SQL blocks.
Obtaining and returning elements to and from the pool
To retrieve an OraDatabase object from the pool, the GetDatabaseFromPool method is called. This function returns a reference to an OraDatabase object.
Destroying the pool
The pool is implicitly destroyed if the parent session object that it belong
to is destroyed. It can also be destroyed at any time by invoking the DestroyDatabasePool method.
Accessing the Pool attributes
The following are the Database Pool Properties. These properties are read-only.
DbPoolMaxSize
// Maximum Pool Size
DbPoolCurrentSize
// Current Size of the Pool
DbPoolInitialSize
// Initial Size of the Pool
Doing Transaction processing using the Database from the Connection Pool
This is the recommended way of doing transactions:
set Odb = OraSession.GetDatabaseFromPool(0)
Odb.Connection.BeginTrans
…
Odb.Connection.CommitTrans