numServers internal use and clientInfo problem

62 views
Skip to first unread message

Mert ÇALIŞKAN

unread,
Oct 27, 2016, 11:22:07 PM10/27/16
to H2 Database
Hi,

I'm trying to use h2 db v1.4.192 with Payara Application server (it's a fork of GlassFish) but I'm getting the SQLClient exception given below.

java.sql.SQLClientInfoException: Property name 'numServers is used internally by H2.
at org.h2.jdbc.JdbcConnection.setClientInfo(JdbcConnection.java:1711)
at org.h2.jdbc.JdbcConnection.setClientInfo(JdbcConnection.java:1768)
at com.sun.gjc.spi.jdbc40.ConnectionHolder40.setClientInfo(ConnectionHolder40.java:332)

The reason behind is, JdbcConnection class sets numServers as clientInfo and Payara's ConnectionHolder40 class get this default client info and sets it to JdbcConnection by calling setClientInfo. The internal usage check is implemented in v1.4.192 and previous version of H2 (1.4.191) works ok with the Payara application server.

How can I resolve this issue?

Noel Grandin

unread,
Oct 28, 2016, 2:59:03 AM10/28/16
to h2-da...@googlegroups.com
Unfortunately, you can pretty much either patch H2 or patch Payara.

Payara should really not be doing that, that's very dodgy behaviour.

I suspect it is doing it to work around some other databases behaviour, in which case it should probably be checking and only doing it for that database.

Mert ÇALIŞKAN

unread,
Oct 28, 2016, 4:46:57 AM10/28/16
to H2 Database
I can patch Payara. I can remove numServers from the clientInfo list and set to clientInfo's on JdbcConnection. But I don't know if you're the only db that uses that numServers property.

28 Ekim 2016 Cuma 09:59:03 UTC+3 tarihinde Noel Grandin yazdı:

Noel Grandin

unread,
Oct 28, 2016, 4:49:50 AM10/28/16
to h2-da...@googlegroups.com
I would be surprised if anyone else is using it.

Mert ÇALIŞKAN

unread,
Oct 28, 2016, 4:55:48 AM10/28/16
to H2 Database
ok thanks Noel, 
I have one question for clarification on this. Can you elaborate the case of having numServers defined as an internal property? If it's an internal property what's the reason behind setting it into client info?

28 Ekim 2016 Cuma 11:49:50 UTC+3 tarihinde Noel Grandin yazdı:

Noel Grandin

unread,
Oct 28, 2016, 4:57:58 AM10/28/16
to h2-da...@googlegroups.com
it's internal in the sense that you can't override it by setting it explicitly - that's a safety feature, to prevent
people accidentally sticking their own property with the same name in and then getting confused when they get a
different value back out.
Reply all
Reply to author
Forward
0 new messages