Grails accessing H2 TCP server hangs

人盡茶涼 提交于 2019-11-29 13:38:20
"unexpected status 16777216 / 16842752" (0x1000000 / 0x1010000):

It could be incompatible client and server versions of H2. Even thought the client and the server negotiate which transport protocol version to use, so in theory this should not be a problem. So that would be a bug in the server or client implementation. According to the error code, the client is version 1.3.173, and the server is version 1.4.180 as you wrote. Could you ensure you use the same version for both client and server?

GKislin

I've problem: Connection is broken: "unexpected status 16843008" when try to refresh h2 from JetBrains IDEA Database, connected by tcp: jdbc:h2:tcp://localhost:9092/~/dbname, h2.version=1.4.190

@Bean(initMethod = "start", destroyMethod = "stop")
public Server h2Server() throws SQLException {
    return Server.createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", "9092");
}

Problem solved only when downgrade h2 version:

    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>1.3.176</version>
    </dependency>

Be sure to use the same h2 driver version at application and client (ex. IDEA Database) side.

It also work for InMemory (for spring boot server: spring.datasource.url=jdbc:h2:mem:dbname and for tcp client: tcp://localhost:9092/mem:dbname)

See. Connecting to H2 server from DbVisualizer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!