Comment 0 for bug 1311954

Revision history for this message
Alexey Panteleev (alexey-0) wrote :

Hello,

 We use the following code in our app to test if a database/catalog exists

 try {
  connection.setCatalog(name);
 }catch(SQLException ex){
// Analyze SQL code here to detect "unknown catalog" error
}

 For some other reasons (stale connections) we've enabled setTransactionRecoveryEnabled(true) mode and that now breaks our catalog testing try/catch. For some reason BoneCP's setCatalog() throws UndeclaredThrowableException instead of SQLException

java.lang.reflect.UndeclaredThrowableException: null
        at com.sun.proxy.$Proxy0.setCatalog(Unknown Source) ~[na:na]
        at com.jolbox.bonecp.ConnectionHandle.setCatalog(ConnectionHandle.java:1305) ~[bonecp-0.8.0.RELEASE.jar:na]
        at com.yoxel.db.server.ClientModel.getNewPoolConnection(ClientModel.java:117) ~[server-1.1-SNAPSHOT.jar:na]

Any ideas?