You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Michelle Harris <mh...@site59.com> on 2002/09/06 22:46:24 UTC

Bug Report: JdbcConnectionFactory -- logging error if unable to create connection

Hello:

We are using Avalon/Excalibur for an application running against Oracle.
When we hit a db error upon the initialization/creation of database
connection pool, we don't see the specific oracle error that prevents us
from making the connection. Examples of situations that would trigger
such errors include the wrong username/password combo and maximum # of
connections exceeded.

When using an incorrect username/password, we see the following error at
the top of the stack trace:

 [java] 2002-09-06-12-17-39 WARN  [application-logger.oracle-conn]:
Could not
return Connection
     [java]
org.apache.avalon.excalibur.datasource.NoAvailableConnectionException:
You
cannot get a Poolable before the pool is initialized
     [java]     at
org.apache.avalon.excalibur.datasource.JdbcDataSource.getConnection(JdbcDataSource.java:220)
     [java] java.lang.IllegalStateException: You cannot get a Poolable
before
the pool is initialized
     [java]     at
org.apache.avalon.excalibur.pool.DefaultPool.get(DefaultPool.java:109)
     [java]     at
org.apache.avalon.excalibur.datasource.JdbcConnectionPool.get(JdbcConnectionPool.java:136)
 

Upon research, I have come to the conclusion that the lack of precise
information regarding why we could not get a connection is due to the
constructor for JdbcConnectionFactory swallowing any exception that
occurs in the call to DriverManager.getConnection. As the comment states
in the catch block for the Exception here, it is very difficult to track
down the cause without any logging.

As such -- and acknowledging that there is no access to a logger at this
point in the code -- what are the options to output the specific
Exception/error information? Of course, there is always the option of
using System.out or System.err, but there has to be a better way. What
do you guys think?

Cheers,
Michelle Harris


-- 
Michelle Harris | Developer
www.site59.com
90 William Street, 16th Floor
New York, NY 10038
212.324.3255

Site59, a Travelocity Company -- www.site59.com
Providing dynamic technology solutions to the world's leading travel
websites 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>