Currently, the Session Manager provides connectivity with Oracle9i, and the Pluggable Resource Interface allows you to create session management for the database of your choice. See “Pluggable Database Resource Module for VisiTransact” for more information about the Pluggable Resource Interface.The Session Manager is linked with applications that use it. Using the Session Manager may require certain command-line parameters to be used when starting these application processes. For information about the command-line parameters, see “Commands, utilities, arguments, and environment variables”.How do the application and Session Manager work together? The application uses resolve_initial_references() to obtain a reference to the Session Manager's ConnectionPool object. The application provides the ConnectionPool with the appropriate configuration profile name and the ConnectionPool obtains a connection to the database using the configuration in that profile. The ConnectionPool then returns a Connection object which represents this database connection to the application.For more specific information about using the Session Manager API to get a connection to the database, see “Data access using the Session Manager”.Programming restrictions vary according to the specific Session Manager implementation your application is using. For information on programming requirements and limitations while using the database's native API to do the work of the transaction (SQL statements, etc.), see “XA Session Manager for Oracle OCI, version 9i Client” and “DirectConnect Session Manager for Oracle OCI, version 9i Client”.All the information needed for the connection is kept in connection profiles. Each profile has a unique name and consists of attributes such as the database login ID. The set of attributes varies depending on the Session Manager implementation. For more information, see “XA Session Manager for Oracle OCI, version 9i Client” and “DirectConnect Session Manager for Oracle OCI, version 9i Client”.Use the VisiBroker Console to create and configure connection profiles. The connection profile has all the required attributes to make a connection to the database. For more information about the VisiBroker Console, see “Using the VisiBroker Console”.The Session Manager automatically registers the appropriate Resources with the Coordinator—application developers do not need to add anything to their code for Resource registration. While the DirectConnect implementation contains the Resource object invisibly embedded in the Session Manager implementation, the XA implementation uses an external process called the XA Resource Director. The XA Resource Director must be available to use the XA version of the Session Manager. For information about starting an XA Resource Director, see “Integrating VisiTransact with databases using the Session Manager”.
• Not all database connections have threading restrictions. When restrictions do not exist, the Session Manager pools connections more efficiently. For more information, see “Data access using the Session Manager”.For more information about the rules used during transaction completion or a two-phase commit, see “Transaction completion” and “Coordinating transaction completion with Resource objects”.When only one application server talking to one database is involved in a transaction, the DirectConnect Session Manager is an alternative to using global (two-phase commit) transactions as provided by the XA implementation of the Session Manager. This consists of a single process containing a Session Manager with embedded Resources. For optimum performance, an VisiTransact Transaction Service instance is linked with the application code; however, this is not required. A transaction using the DirectConnect Session Manager is considered a local transaction because all of the components of the transaction are located locally in one process. With DirectConnect access transactions one process talks to one database. All of the work for a particular transaction is done on one physical database connection. The connection uses the same connection profile whenever the database is accessed for the same transaction. The benefit of this type of architecture is a gain in performance because it performs a single-phase commit only. It also allows transactional semantics for work done on databases which do not support two-phase commit.In other words, because the Session Manager manages connections, every time the application invokes getConnection() for the same transaction, it will get the same connection. The server can have many calls for the same transaction and all the work happens within the same transaction even though the application code did not have to maintain connection state.If you try to register a Resource (register_resource() call) after a DirectConnect Resource has already been registered, this results in a CORBA::BAD_PARAM exception. In other words, the VisiTransact Transaction Service will not accept any register_resource() calls after a DirectConnect connection has been used.If getConnection() attempts to obtain a DirectConnect connection, and a Resource has already been registered with the Coordinator, the request will fail throwing a VISSessionManager::Error exception.
• Only one thread at a time can obtain a connection for a particular transaction. Once getConnection() has been invoked, no other thread will be able to obtain a connection for that transaction until the connection has been released.The design of the Session Manager allows for the coexistence of DirectConnect and XA access transactions in the same process. Certain database implementations will not allow the mixing of DirectConnect and XA access transactions from the same process. For example, the Oracle 9i DirectConnect and XA implementations are not compatible in the same process, so VisiTransact will prevent you from mixing these two implementations. See “XA Session Manager for Oracle OCI, version 9i Client” and “DirectConnect Session Manager for Oracle OCI, version 9i Client” for details on specific implementations of the Session Manager.