wood burning stoves 2.0*
The moose likes JDBC and the fly likes Could not get a good connection to the database ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Could not get a good connection to the database ?" Watch "Could not get a good connection to the database ?" New topic
Author

Could not get a good connection to the database ?

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
hi all,

when I run *all* my test (~100) I receive the trace bellow. but when I run them one by one, they are all green.

what does it mean: Could not get a good connection to the database, and how can I avoid it

thank you


[ April 11, 2007: Message edited by: Bear Bibeault ]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30405
    
150

Peter,
Some databases throw exceptions if you ask for a lot of connections and don't close them all (something that happens more often in test code.) Some take time to close the connection causing the resource to appear unavailable even if you are properly closing the connection. Since the integration tests run so quickly, this is a stress on the resources.

We hit this with Oracle and switched our test code to use a connection pool data source. The code under test was fine because it was already using connection pooling.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Could not get a good connection to the database ?