Cannot access a data source
What kind of database are you trying to access?
If the errors described in the previous articles do not match the errors
you see:
- Browse the log files of the application server that contains the application,
for clues.By default these files are install_root/server_name/SystemErr.log and SystemOut.log.
- Browse the Helper Class property of the data source to verify that it
is correct and that it is on the WebSphere Application Server class path.
Mysterious errors or behavior might result from a missing or misnamed Helper
Class name. If WebSphere Application Server cannot load the specified class,
it uses a default helper class that might not function correctly with your
database manager.
- Verify that the Java Naming and
Directory Interface (JNDI) name of the data source matches the name used by
the client attempting to access it. If error messages indicate that the problem
might be naming-related, such as referring to the name server or naming
service, or including error IDs beginning with NMSV, look at the Naming related problems and Troubleshooting the naming service
component topics.
- Enable tracing for the resource adapter using the trace
specification, RRA=all=enabled. Follow the instructions for dumping and browsing
the trace output, to narrow the origin of the problem.
If none of these steps fixes your
problem, see if the problem is identified and documented in available online support (hints and tips, technotes, and
fixes). If none of the online resources listed in the topic describes
your problem, see Obtaining help from IBM.
General data access problems
IllegalConnectionUseException
This
error can occur because a connection obtained from a WAS40DataSource is being
used on more than one thread. This usage violates the J2EE 1.3 programming
model, and an exception generates when it is detected on the server. This
problem occurs for users accessing a data source through servlets or bean-managed
persistence (BMP) enterprise beans.
To confirm this problem, examine
the code for connection sharing. Code can inadvertently cause sharing by not
following the programming model recommendations, for example by storing a
connection in an instance variable in a servlet, which can cause use of the
connection on multiple threads at the same time.
WTRN0062E:
An illegal attempt to enlist multiple one phase capable resources has occurred
This
error can occur because:
- An attempt was made to share a single-phase connection, when each getConnection method
has different connection properties; such as the AccessIntent. This attempt
causes a non-shareable connection to be created.
- An attempt was made to have more than one unshareable connection participate
in a global transaction, when the data source is not an XA resource.
- An attempt was made to have a one-phase resource participate in a global
transaction while an XA resource or another one-phase resource already participated
in this global transaction.
- Within the scope of a global transaction you try to get a connection more
than once and at least one of the resource-refs you use specifies that the
connection is unshareable, and the data source is not configured to support
two-phase commit transactions. It does not support an XAResource. If you do
not use a resource-ref, you default to unshareable connections.
- Within the scope of a global transaction you try to get a connection more
than once and at least one of the resource-refs you use specifies that the
connection is shareable and the data source is not configured to support
two-phase commit transactions. That is, it does not support an XAResource.
In addition, even though you specify that connections are shareable, each
getConnection request is made with different connection properties (such as
IsolationLevel or AccessIntent). In this case, the connections are not shareable,
and multiple connections are handed back.
- Multiple components (servlets, session beans, BMP entity beans, or CMP
entity beans) are accessed within a global transaction. All use the same data
source, all specify shareable connections on their resource-refs, and you
expect them to all share the same connection. If the properties are different,
you get multiple connections. AccessIntent settings on CMP beans change their
properties. To share a connection, the AccessIntent setting must be the same.
For more information about CMP beans sharing a connection with non-CMP components,
see the Data access application programming interface support and Example:
Accessing data using IBM extended APIs to share connections between container-managed
and bean-managed persistence beans topics in the DataAccess section of
the information center.
To correct this error:
- Check what your client code passes in with its getConnection requests,
to ensure they are consistent with each other.
- Check the connection sharing scope from
the resource binding, using the .
- If you are running an unshareable connection scope, verify that your data
source is an XA data source.
- If you are running a shareable connection scope, verify that all connection
properties, including AccessIntent, are sharable.
- Check the JDBC provider implementation class from the Manage JDBC resource
panel of the administrative console to ensure that it is a class that supports
XA-type transactions.
ConnectionWaitTimeoutException accessing
a data source or resource adapter
If your application receives
exceptions like a com.ibm.websphere.ce.cm.ConnectionWaitTimeoutException or
com.ibm.websphere.ce.j2c.ConnectionWaitTimeoutException when attempting to
access a WebSphere Application Server data source or JCA-compliant resource
adapter, respectively, some possible causes are:
- The maximum number of connections for a given pool is set too low. The
demand for concurrent use of connections is greater then the configured maximum
value for the connection pool. One indication that this situation is the problem
is that you receive these exceptions regularly, but your CPU utilization is
not high. This exception indicates that there are too few connections available
to keep the threads in the server busy.
- Connection Wait Time is set too low. Current demand for connections is
high enough such that sometimes there is not an available connection for short
periods of time. If your connection wait timeout value is too low, you might
timeout shortly before a user returns a connection back to the pool. Adjusting
the connection wait time can give you some relief. One indication of this
problem is that you use close to the maximum number of connections for an
extended period and receiving this error regularly.
- You are not closing some connections or you are returning connections
back to the pool at a very slow rate. This situation can happen when using
unshareable connections, when you forget to close them, or you close them
long after you are finished using them, keeping the connection from returning
to the pool for reuse. The pool soon becomes empty and all applications get
ConnectionWaitTimeoutExceptions. One indication of this problem is you run
out of connections in the connection pool and you receive this error on most
requests.
- You are driving more load than the server or backend system have resources
to handle. In this case you must determine which resources you need more
of and upgrade configurations or hardware to address the need. One indication
of this problem is that the application or database server CPU is nearly 100%
busy.
To correct these problems, either:
- Modify an application to use fewer connections
- Properly close the connections.
- Change the pool settings of MaxConnections or ConnnectionWaitTimeout.
- Adjust resources and their configurations.
com.ibm.websphere.ce.cm.StaleConnectionException:
[IBM][CLI Driver] SQL1013N The database alias name or database name "NULL"
could not be found. SQLSTATE=42705
This error occurs when a data
source is defined but the databaseName attribute and
the corresponding value are not added to the custom properties panel.
To
add the databaseName property:
- Click Resources>Manage JDBC Providers link in the administrative
console.
- Select the JDBC provider that supports the problem data source.
- Select Data Sources and then select the problem data source.
- Under Additional properties click Custom Properties.
- Select the databaseName property, or add one if it does not exist,
and enter the actual database name as the value.
- Click Apply or OK, and then click Save from the action
bar.
- Access the data source again.
java.sql.SQLException: java.lang.UnsatisfiedLinkError:
This
error indicates that the directory containing the binary libraries which support
a database are not included in the LIBPATH environment variable for the environment
in which the WebSphere Application Server starts.
The path containing
the DBM vendor libraries vary by dbm. One way to find them is by scanning
for the missing library specified in the error message. Then you can correct
the LIBPATH variable to include the missing directory, either in the .profile of
the account from which WebSphere Application Server is executed, or by adding
a statement in a .sh file which then executes the startServer program.
"J2CA0030E: Method enlist caught java.lang.IllegalStateException"
wrapped in error "WTRN0063E: An illegal attempt to enlist a one phase capable
resource with existing two phase capable resources has occurred" when attempting
to execute a transaction.
This error can occur when last participant
support (LPS) is missing or disabled. LPS allows a one-phase capable resource
and a two-phase capable resource to enlist within the same transaction.
LPS
is only available if the following are true:
- WebSphere Application Server Programming Model Extensions (PME) is installed.
PME is included in the Application Server Integration Server product.
- The Additional Integration Server Extensions option is enabled when PME
is installed. If you perform a typical installation, this function is enabled
by default. If you perform a custom installation, you have the option to disable
this function, which disables LPS.
- The application enlisting the one-phase
resource is deployed with the Accept heuristic hazard option
enabled. This deployment is done through the . To enable this option in the :
- Load the EAR file into the .
- If the EAR file is actually a JTEE1.2 EAR then it must
be upgraded to a JTEE1.3 EAR by clicking File> Convert EAR from
the .
- Select the EAR file in the left-hand panel of the .
- Select the WAS Integration Server tab in the bottom right window
panel of the
- Ensure that the Accept heuristic hazard option is selected.
- Save the EAR file.
java.lang.UnsatisfiedLinkError:xaConnect exception
when attempting a database operation
This problem has two main
causes:
"J2CA0114W:
No container-managed authentication alias found for connection factory or
datasource datasource" when attempting a database operation
This
error might occur in the SystemOut.log file when you
run an application to access a data source after creating the data source
using JACL script.
The error message occurs because the JACL script
did not set container-managed authentication alias for CMP connection factory.
The JACL is missing the following line:
$AdminConfig create MappingModule $cmpConnectorFactory "{mappingConfigAlias DefaultPrincipalMapping} {authDataAlias $authDataAlias}
To correct this problem, add the missing line to the JACL script and
run the script again. See Example: Creating a JDBC provider and data source using Java Management Extensions API and the scripting tool for
a sample JACL script.

Troubleshooting by task: What are you trying to do?
Troubleshooting by component: What is not working?
Example: Accessing data using IBM extended APIs to share connections between container-managed and bean-managed persistence beans

Data access application programming interface support
Problems accessing an Oracle data source
Problems accessing a DB2 database
Problems accessing a SQL server data source
Problems accessing a Cloudscape database
Problems accessing a Sybase data source
Searchable topic ID:
rtrb_dsaccess
Last updated: Jun 21, 2007 8:07:48 PM CDT
WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/ae/rtrb_dsaccess.html