H2DB upgrade from 1.4.195 to 2.0.206 - Breaks - Version mismatch, driver version is "0" but server version is "16"

1,212 views
Skip to first unread message

ashi...@gmail.com

unread,
Jan 10, 2022, 1:11:05 AM1/10/22
to H2 Database
Dear all, 

I just replaced my h2db jar from 1.4.195 to 2.0.206 and it is failing in db connection. 

org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.h2.jdbc.JdbcSQLException: Version mismatch, driver version is "0" but server version is "16" [90047-195]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
        at org.h2.message.DbException.get(DbException.java:179)
        at org.h2.server.TcpServerThread.run(TcpServerThread.java:89)
        at java.lang.Thread.run(Thread.java:748)

        at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82) ~[spring-jdbc-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:612) ~[spring-jdbc-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:669) ~[spring-jdbc-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:700) ~[spring-jdbc-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712) ~[spring-jdbc-5.2.15.RELEASE.jar:5.2.15.RELEASE]
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:763) ~[spring-jdbc-5.2.15.RELEASE.jar:5.2.15.RELEASE]

Evgenij Ryazanov

unread,
Jan 10, 2022, 4:03:49 AM1/10/22
to H2 Database
Hello!

You still have 1.4.195 somewhere.

TCP protocol in H2 2.0.206 provides backward compatibility for 1.4.197 and newer versions only.

Client with 1.4.195 cannot connect to server with 2.0.206 and client with 2.0.206 cannot connect to server with 1.4.195; these versions are too different from each other.

Normally you should have the same version of H2 on both client and server side (or in all applications that use auto-server mode).

Silvio

unread,
Jan 11, 2022, 7:37:40 AM1/11/22
to H2 Database
Can you elaborate on that? As I described in another recent post we plan to use at least two H2 versions (1.4.200 for legacy databases and 2.0.20x for all new ones) from the same application by using 2.0.20x in the application itself (embedded mode) and spawn a separate H2 TCP-server process that uses 1.4.200.

That means we will use 2.0.20x as the client for a 1.4.200 server. Is that not going to work? Or is backward compatibility from a newer H2 client to a (somewhat) older H2 version server likely?

Evgenij Ryazanov

unread,
Jan 11, 2022, 8:19:29 AM1/11/22
to H2 Database
On Tuesday, 11 January 2022 at 20:37:40 UTC+8 Silvio wrote:
Can you elaborate on that? As I described in another recent post we plan to use at least two H2 versions (1.4.200 for legacy databases and 2.0.20x for all new ones) from the same application by using 2.0.20x in the application itself (embedded mode) and spawn a separate H2 TCP-server process that uses 1.4.200.
Client with H2 2.0.206 should be able to connect to servers with H2 1.4.197 and newer versions.

It cannot be used with older servers (1.4.196 and below).

Silvio

unread,
Jan 11, 2022, 10:18:20 AM1/11/22
to H2 Database
Thanks. That is just what we need.
Reply all
Reply to author
Forward
0 new messages