How to change from shared to unshared connections
 Technote (troubleshooting)
 
Problem(Abstract)
Two items must be considered when changing connection use from sharable (the default) to unsharable. 1) Resource references must be created. 2) Application code must be modified.
 
Cause
WebSphere® Application Server Version 4.0 used all unshared connections. Shared connections were introduced with Version 5. Shared connections are the default setting for all versions of WebSphere 5.0 and 6.0.

In some cases, it is necessary to change the connection usage from sharable to unsharable due to the manner in which the application is coded.

An application might use more connections than anticipated depending on the way connection handles are obtained and used within the scope of local transaction containments (LTCs).

 
Resolving the problem
The following WebSphere Application Server Information Center topics provide more details about these issues:
Once you determine that the connection usage should be changed from sharable to unsharable, the following two items must be completed:
  1. For each web module that accesses the datasources you want to modify, you need to create a resource reference. Once created, the resource reference configuration is stored in the web.xml file contained in the WAR file. The resource reference is where you specify that you want to use unsharable as the sharing scope. Refer to the following WebSphere Application Server Information Center topic for more details: Creating or changing a resource reference. This topic explains the steps necessary to create a resource reference using the Assembly Toolkit. This can also be accomplished by using WebSphere Studio Application Developer.

  2. The application code must be modified to use indirect JNDI lookups. Resource references are accessed only when doing indirect JNDI lookups. Direct JNDI lookups do not use resource references and always result in the default value of sharable being used. Refer to the following Information Center topic for more details: Looking up data sources with resource references for relational access. This topic describes how the lookup should be done in order to use resource references
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > DB Connections/Connection Pooling
Operating system(s): z/OS
Software version: 6.1
Software edition:
Reference #: 1223465
IBM Group: Software Group
Modified date: Sep 6, 2007