How to Configure Websphere Application Server 8

This section provides descriptions and examples of configuring the TimesTen JDBC driver for use with IBM WebSphere Application Server 8.

Assumption: Oracle TimesTen and IBM WebSphere Application Server 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 TimesTen Connections and Properties

The TimesTen JDBC driver supports four different types of connections to access the TimesTen database:

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 Websphere application server and the TimesTen database must be running in the same machine.

TimesTen Class: com.timesten.jdbc.ObservableConnectionDS

Example URL Property: jdbc:timesten:direct:sampledb_1122

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 Websphere Application Server. This connection type incurs distributed transaction overhead.

TimesTen Class: com.timesten.jdbc.xa.TimesTenXADataSource

Example URL Property: jdbc:timesten:direct:sampledb_1122

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 Websphere 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.ObservableConnectionDS

Example URL Property: jdbc:timesten:client:sampledb_1122

Client/server access with XA distributed transactions
The JDBC driver supports XA distributed transactions. For client/server connections, the Websphere 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.TimesTenXADataSource

Example URL Property: jdbc:timesten:client:sampledb_1122

 

Configuring a TimesTen JDBC Provider

Before you can WebSphere to access TimesTen data stores the server environment must have access to the TimesTen JDBC driver jar file and the native libraries. In WebSphere this can be done by configuring a JDBC provider in the WebSphere administration console. Follow these steps.

1.
From the Integrated Solution Console, select Resources --> JDBC --> JDBC Providers
2.
Select a scope from the drop-down list box
3.
Click New
4.
In the Create new JDBC Provider screen,
> Database type: select 'User-defined'
> Implementation class name: enter com.timesten.jdbc.ObservableConnectionDS
> Name: TimesTen (local transactions) [See Figure 1 for example]
> Click Next


Figure 1
5. At the Enter database class path information screen

> Enter the path to the TimesTen JDBC driver. Choose the proper TimesTen JDBC driver jar file depending on the JDK version used in Websphere Application Server (either <TimesTen_install_dir>/lib/ttjdbc5.jar or ttjdbc6.jar)
<TimesTen_install_dir> is the home directory where you installed Oracle TimesTen.

> Click Next [See Figure 2 for example]


Figure 2
6. On the Summary screen, click Finish
7. At the JDBC providers screen click the provider name that you just created
8. At the General properties screen
> Enter the path to the TimesTen shared libraries in the Native library path field. On UNIX platforms the path is <TimesTen_install_dir>/lib. On Windows platforms the path is <TimesTen_install_dir>/bin. [See Figure 3 for example]
> Click Apply


Figure 3
9. Click Save to save the new configuration.

Configuring TimesTen Data Sources

Data sources are associated with specific JDBC providers defined in the previous section. Follow these steps to configure TimesTen data sources from the WebSphere administration console:

1.
Connect to the WebSphere administration console
2..
Select Resources->JDBC->Data sources
3.
Select a scope from the drop down list box.
4.
Click the New button
5.
At the Enter basic data source information screen enter a name and a JNDI name for the data source. Click Next
6.
At the Select JDBC provider screen select the TimesTen JDBC Provider created in the previous section. Click Next.
7.
At the Enter database specific properties for the data source screen use com.ibm.websphere.rsadapter.GenericDataStoreHelper for the Data store helper class name field. Make sure that the Use this data store in container managed persistence check box is checked. Click Next
8.
On the following summary screen click Finish
9.
At the Data sources screen click on the name of the TimesTen data source that you just created.
10,
Click Custom properties
11.

Click url property, in the value field enter the TimesTen JDBC URL for the DSN that this data source should connect to. A TimesTen URL takes the form: jdbc:timesten:<direct|client>:<DSN>. For a direct DSN named sampledb_1122 the screen should look similar to Figure 4.
   
Figure 4

12.
Click user property, in the value field enter the TimesTen user that this data source should connect as.
13.
Click password property, in the value field enter the password for the TimesTen user provided in the previous step.
14.
Click webSphereDefaultIsolationLevel property, in the value field enter 2 for READ_COMMITTED.
15.
Click Apply
16
Click Save to save the configuration
17.
Restart the server before attempting to make connection to the new TimesTen data source.

Troubleshooting TimesTen Connections

Various problems may occur when using TimesTen with WebSphere. The list below describes possible solutions for common problems.

1.
When clicking on Test Connection for a TimesTen data source on the Data sources screen of the administration console, TimesTen throws a java.lang.IllegalAccessError exception. This problem can occur if you have configured a new TimesTen data source but have not restarted the server. Try restarting the server to solve the problem
2.
When attempting to establish a connection to a TimesTen data source from within WebSphere, TimesTen throws the exception “TT0837: Cannot attach data store shared-memory segment.” This problem is likely to occur on 32-bit platforms when the system is unable to allocate or map enough contiguous shared memory to hold the TimesTen database. For detailed instructions on how to resolve this and other connection problems see the Oracle TimesTen In-Memory Database Troubleshooting Procedures Guide and the Oracle TimesTen In-Memory Database Installation Guide. These troubleshooting steps are recommended.

a.
Verify that it is possible to connect to the TimesTen data store outside of the WebSphere JVM. You can use the ttIsql utility for this purpose.
b.
Try increasing the maximum amount of shared memory available to the system. See the Oracle TimesTen In-Memory Database Installation Guide for platform specific details.
c.
Try decreasing the size of the TimesTen data store by recreating the data store with lower values for the PermSize and TempSize connection attributes.
d.
Terminate any unnecessary processes on the system to make more memory available.
e.
Try a client/server TimesTen JDBC connection instead of a direct connection for the WebSphere data source.
f.
If possible try a 64-bit version of TimesTen and WebSphere.

Place the cursor over this icon to hide all screenshots.