How to Configure Oracle Application Server 10g

This section provides descriptions and examples of configuring the TimesTen JDBC driver for use with Oracle Application Server 10g

Assumption: Oracle TimesTen and Oracle Application Server (OAS) have been successfully installed on the same host machine and that both instances are running.

Place the cursor over this icon to view images in this tutorial.

Configuring The TimesTen JDBC Driver

Before you can use Oracle Application Server to access the TimesTen databases, the server environment must have access to the TimesTen JDBC driver jar file and the TimesTen shared libraries. Here are the steps:
Step 1.
Copy the TimesTen JDBC driver jar file from the TimesTen install directory to the OAS install directory:

Copy <TimesTen_install_dir>/lib/ttjdbc5.jar (or ttjdbc6.jar) to <OAS_install_dir>/lib/ext directory.

If OAS is using JDK 1.5, copy the ttjdbc5.jar file, otherwise for JDK 1.6, copy the ttjdbc6.jar file.
Step 2.
Modify the LD_LIBRARY_PATH environment variable (or the equivalent variable for your OS) to include the TimesTen shared library. Append timesten_install_dir/lib to the LD_LIBRARY_PATH (or equivalent) environment variable found in the OAS_install_dir/common/bin/commEnv.sh file.

On Windows, set the PATH environment variable to include the TimesTen_install_dir/bin directory where the TimesTen DLLs are located. The PATH variable must be set for the environment where OAS runs.

Step 3.
If you use OPMN (Oracle Process Manager and Notification Service) to start the application server, modify the OPMN configuration file to include the TimesTen shared libraries location. The OPMN configuration file is located at OAS_install_dir/opmn/conf/opmn.conf.

Open the opmn.conf file, add an entry for the LD_LIBRARY_PATH environment variable (or the equivalent variable for your OS) under the ias-component element associated with the application server. For example, the component called 'OC4J' in the opmn configuration file on the Windows platform:

<ias-component id="OC4J">
<environment>
    <variable id="PATH" value="C:\TimesTen\tt1121_32\bin" append="true" />
</environment>

Step 4.
Restart the Oracle Application Server instance for the changes to take effect.

Configuring Connection Pools and Data Sources

The TimesTen JDBC driver supports four different types of connections for accessing the TimesTen database. The table below shows the connection types and the connection properties.

Each type of TimesTen JDBC driver connection requires a unique data source configuration. The examples below reference a TimesTen DSN, sampledb_1121 for direct-linked connection mode, and sampledbCS_1121 for client/server connection mode. These TimesTen DSNs need to be configured in the odbc.ini or sys.odbc.in file on Unix/Linux platforms, or configured in the Windows Data Source Administrator.

Each TimesTen JDBC driver connection type requires a unique connection pool configuration in the Oracle Application Server. One or more data source objects may be associated with each connection pool.

Sample connection pool and data source configurations are described below for each of the four types of TimesTen connections.


Direct-linked connections with local transactions only
This configuration is an in-process linked to the TimesTen database libraries; direct-linked connection provides the best response time for database operations and results in higher transaction throughput. To use this configuration, the Oracle Application Server and the TimesTen database must be running in the same machine.

TimesTen Class: com.timesten.jdbc.TimesTenDriver
Example URL: jdbc:timesten:direct:sampledb_1121

Figure 1
Figure 1

Sample oas_install_dir/j2ee/home/config/data-sources.xml entries:

<connection-pool name="TimesTenDirectPool">
     <connection-factory factory-class="com.timesten.jdbc.TimesTenDriver"
     url="jdbc:timesten:direct:sampledb_1121"/>
</connection-pool>

<managed-data-source
    connection-pool-name="TimesTenDirectPool" jndi-name="jdbc/TimesTenDirectDS"     name="TimesTenDirectDS" tx-level="local"
/managed-data-source
>


Figure 2

Direct-linked connection with XA distributed transactions
The JDBC driver supports XA distributed transactions. For directed-link connections, the TimesTen database must reside on the same machine as the Oracle Application Server. This connection type incurs distributed transaction overhead.

TimesTen Class: com.timesten.jdbc.xa.TimesTenXADataSource
Example URL: jdbc:timesten:direct:sampledb_1121

Figure 3
Figure 3

Example Oracle_install_dir/j2ee/home/config/datasources.xml entries:

<connection-pool name="TimesTenDirectXAPool">
     <connection-factory factoryclass="com.timesten.jdbc.xa.TimesTenXADataSource"
     url="jdbc:timesten:direct:sampledb_1121"/>
</connection-pool>

<managed-data-source
    connection-pool-name="TimesTenDirectXAPool" jndiname="jdbc/TimesTenDirectXADS"
    name="TimesTenDirectXADS"
/manage-data-source>

Figure 4
Figure 4

Client/server access with local transactions only
Client/Server connections are intended for applications not running in the same machine as the TimesTen database. Here, the Oracle Application Server can access the TimesTen database from a remote machine. This connection mode incurs network (TCP/IP) overhead and is less responsive as the direct-linked connection mode.

TimesTen Class: com.timesten.jdbc.TimesTenDriver
Example URL: jdbc:timesten:client:sampledbCS_1121

Figure 5
Figure 5

Example Oracle_install_dir/j2ee/home/config/datasources.xml entries:

<connection-pool name="TimesTenClientPool">
    <connection-factory factory-class="com.timesten.jdbc.TimesTenDriver"
     url="jdbc:timesten:client:sampledbCS_1121"/>
</connection-pool>

<managed-data-source
    connection-pool-name="TimesTenClientPool" jndiname="jdbc/TimesTenClientDS"
    name="TimesTenClientDS" tx-level="local"
/manage-data-source/>

Figure 6
Figure 6

Client/server access with XA distributed transactions
The JDBC driver supports XA distributed transactions. For client/server connections, the Oracle Application Server may access the TimesTen database from a remote machine.This connection type incurs network overhead in addition to the distributed transaction overhead.

TimesTen Class: com.timesten.jdbc.xa.TimesTenXADatatSource
Example URL: jdbc:timesten:client:sampledbCS_1121

Figure 7
Figure 7

Example Oracle_install_dir/j2ee/home/config/datasources.xml entries:

<connection-pool name="TimesTenClientXAPool">
    <connection-factory factory-class="com.timesten.jdbc.xa.TimesTenXADataSource"
     url="jdbc:timesten:client:sampledbCS_1121"/>
</connection-pool>

<managed-data-source
    connection-pool-name="TimesTenClientXAPool" jndiname="jdbc/TimesTenClientXADS"
    name="TimesTenClientXADS"
/manage-data-source/>

Figure 8
Figure 8

 

Place the cursor over this icon to hide all screenshots.