commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18834] New: - Jdbc2PoolDataSource throws a RuntimeException when database can't be found.
Date Tue, 08 Apr 2003 20:49:53 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18834>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18834

Jdbc2PoolDataSource throws a RuntimeException when database can't be found.

           Summary: Jdbc2PoolDataSource throws a RuntimeException when
                    database can't be found.
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: cevans@mobilesys.com


Jdbc2PoolDataSource throws a java.lang.RuntimeException when a database cannot
be found.  It should throw an SQLException or some other checked exception.  

It appears that the root cause is that KeyedCPDSConnectionFactory.makeObject()
catches the SQLException and re-throws it as a RuntimeException.  It shouldn't
catch the exception at all.  The interface
KeyedPoolableObjectFactory.makeObject() throws Exception, so this shouldn't be a
problem.

Here is the stack trace:
--
java.lang.RuntimeException: General error,  message from server: "Unknown
database 'mnet_22_routing_c'"
	at
org.apache.commons.dbcp.jdbc2pool.KeyedCPDSConnectionFactory.makeObject(KeyedCPDSConnectionFactory.java:173)
	at
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:760)
	at
org.apache.commons.dbcp.jdbc2pool.Jdbc2PoolDataSource.getConnection(Jdbc2PoolDataSource.java:1096)
	at
org.apache.commons.dbcp.jdbc2pool.Jdbc2PoolDataSource.getConnection(Jdbc2PoolDataSource.java:1028)
--

Thanks in advance!
Coln Evans

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message