Activity log for bug #1311954

Date Who What changed Old value New value Message
2014-04-24 02:11:12 Alexey Panteleev bug added bug
2014-04-24 02:12:18 Alexey Panteleev description 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? 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 Any ideas?
2014-04-24 02:14:59 Alexey Panteleev description 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 Any ideas? 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 ... Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_51] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_51] at com.jolbox.bonecp.MemorizeTransactionProxy.invoke(MemorizeTransactionProxy.java:233) ~[bonecp-0.8.0.RELEASE.jar:na] ... 10 common frames omitted Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'dbname' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_51] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_51] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_51] at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_51] at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.16.jar:na] at com.mysql.jdbc.Util.getInstance(Util.java:386) ~[mysql-connector-java-5.1.16.jar:na] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) ~[mysql-connector-java-5.1.16.jar:na] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597) ~[mysql-connector-java-5.1.16.jar:na] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529) ~[mysql-connector-java-5.1.16.jar:na] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990) ~[mysql-connector-java-5.1.16.jar:na] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151) ~[mysql-connector-java-5.1.16.jar:na] at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619) ~[mysql-connector-java-5.1.16.jar:na] at com.mysql.jdbc.ConnectionImpl.setCatalog(ConnectionImpl.java:5083) ~[mysql-connector-java-5.1.16.jar:na] ... 14 common frames omitted Any ideas? Can the code be enhanced to throw the original exception?