google-code-export / h2database

Automatically exported from code.google.com/p/h2database
0 stars 1 forks source link

Unclear error message when connecting using AUTO_SERVER to a real server DB #279

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
(simple SQL scripts or simple standalone applications are preferred)
1. Start the server and connect to jdbc:h2:tcp://localhost/~/test
2. Connect with a client using the JDBC URL jdbc:h2:~/test;AUTO_SERVER=TRUE

What is the expected output? What do you see instead?

Currently you get the stacktrace:
org.h2.jdbc.JdbcSQLException: Connection is broken: "null" [90067-144]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
    at org.h2.message.DbException.get(DbException.java:156)
    at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:380)
    at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:301)
    at org.h2.engine.SessionRemote.createSession(SessionRemote.java:265)
    at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:110)
    at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:94)
    at org.h2.Driver.connect(Driver.java:72)
[…]
Caused by: java.net.UnknownHostException: null
    at java.net.InetAddress.getAllByName0(InetAddress.java:1158)
    at java.net.InetAddress.getAllByName(InetAddress.java:1084)
    at java.net.InetAddress.getAllByName(InetAddress.java:1020)
    at java.net.InetAddress.getByName(InetAddress.java:970)
    at org.h2.util.NetUtils.createSocket(NetUtils.java:90)
    at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:91)
    at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:376)
    ... 41 more

I would expect to get a message saying (something along the lines of) database 
is not accessible, currently in use by server, auto_server cannot connect to 
this database.

What version of the product are you using? On what operating system, file 
system, and virtual machine?

H2: 1.3.146
OS: MacOS

Do you know a workaround?

Use the correct URL ;-)

How important/urgent is the problem for you?

Not very, although I did have to dig a little to find why it was "broken".

In your view, is this a defect or a feature request?

Hard to say, I think that it is probably a defect, since the error message is 
not clear, and does not guide you to the resolution.

Original issue reported on code.google.com by pwagl...@gmail.com on 31 Jan 2011 at 7:10

GoogleCodeExporter commented 9 years ago
Hi,

Yes, the error message is broken. I will fix that in the next release. Thanks a 
lot for your help!

Regards,
Thomas

Original comment by thomas.t...@gmail.com on 1 Feb 2011 at 7:35

GoogleCodeExporter commented 9 years ago

Original comment by thomas.t...@gmail.com on 9 Feb 2011 at 7:41

GoogleCodeExporter commented 9 years ago
Fixed in version 1.3.151.

Original comment by thomas.t...@gmail.com on 12 Feb 2011 at 2:46