File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes 2 EARs Sharing 1 Data Source Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "2 EARs Sharing 1 Data Source" Watch "2 EARs Sharing 1 Data Source" New topic

2 EARs Sharing 1 Data Source

Elle Atechsy
Ranch Hand

Joined: Jan 23, 2004
Posts: 96

EAR file 1 opens connections when needed and then closes after done. While EAR file 1 may be running, EAR file 2 needs to connect to the same datasource. But it seems that EAR file 2 can never get a connection from the pool. Please see the following errors I get.

J2CA0045E: Connection not available while invoking method queueRequest for resource jdbc/InterfaceMonitor

J2CA0020E: The Connection Pool Manager could not allocate a Managed Connection:

Can anyone tell me if 2 EAR files on the same application server, in WAS 5.1, can use the same datasource & connection pool at the same time? If so, what am I doing wrong?

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33124

You can definitely have two EARs using the same data source at the same time. check the number of "max connections" for the datasource and make sure it isn't one.

You can check this by going to the WAS admin console and looking at the datasource (under resources.)

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: 2 EARs Sharing 1 Data Source
It's not a secret anymore!