Note that there are some explanatory texts on larger screens.

plurals
  1. PODB connection issue between H2 database 1.3.156 (or prior) and 1.3.157 (and onwards)
    primarykey
    data
    text
    <p>As a part of recent migration to latest H2 database jar in my project, I came across a connection issue.</p> <p>The way it works in our project is that one program starts H2 database in server mode and connects to the database. Another program in the same JVM uses the URL <em>"jdbc:h2:tcp://localhost/myfolder/mydb;IGNORECASE=TRUE"</em> and tries creating a connection using java.sql.DriverManager to same database i.e. <em>Connection conn = DriverManager.getConnection(this.url, this.user, this.password);</em></p> <p>But the connection object is not getting created after I migrate to latest H2 jar (Earlier we were using 1.2.147 and it was working fine there). After some analysis, I could narrow down on the fact that if I use H2 version 1.3.156 or below, this code works fine but if I start using H2 version 1.3.157 or above, the connection is not created for the second program. I checked the changelog for both these versions (<a href="http://www.softpedia.com/progChangelog/H2-Database-Engine-Changelog-30870.html" rel="nofollow">http://www.softpedia.com/progChangelog/H2-Database-Engine-Changelog-30870.html</a>) but I could not find anything that might throw some light on this. Note that our H2 database does not contain any table with BLOB/CLOB column.</p> <p>What could be the reason for the same?</p> <p>Regards, Aditya</p> <p><strong>P.S.: Exception stacktrace:</strong></p> <pre><code>org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-174] at org.h2.message.DbException.getJdbcSQLException(DbException.java:332) at org.h2.message.DbException.get(DbException.java:161) at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:417) at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.jav a:305) at org.h2.jdbc.JdbcConnection.&lt;init&gt;(JdbcConnection.java:105) at org.h2.jdbc.JdbcConnection.&lt;init&gt;(JdbcConnection.java:90) at org.h2.Driver.connect(Driver.java:73) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at com.avaya.induna.server.db.DBConnectionManagerImpl.getConnection(DBCo nnectionManagerImpl.java:34) at com.avaya.induna.server.db.backup.BackupImplThread.takeBackup(BackupI mplThread.java:313) at com.avaya.induna.server.db.backup.BackupImplThread.run(BackupImplThre ad.java:175) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at org.h2.util.NetUtils.createSocket(NetUtils.java:119) at org.h2.util.NetUtils.createSocket(NetUtils.java:100) at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:100) at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:413) ... 9 more </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload