I am trying to connect (from an Android device) to a remote HSQLDB web server using:
But I get error SQLException:Connection is broken in my log file.
Is this a memory problem on the device? I have no indication that there is no more memory available.
The client does not use much memory. It may be something specific to the JVM in the Android device.
The complete error log is:
Rejecting allocation of 1011373133-element array
java.sql.SQLException: Connection is broken: java.lang.InternalError: array size too large
How much memory would this "jdbc:hsqldb:http://remoteserveripaddress:port" connection require?
My Android FreeMemory is 1355832, MaxMemory is 16777216, TotalMemory is 5185504
This happens with mismatched versions of client and server. The attempt to allocate huge array is simply an error, not a real memory requirement. Both client and server must be the same version.
If you are using matching versions, this is another possibility:
Routers and servers on the way to your web server may add lines to HTTP headers. HSQLDB cannot handle and discard the extra information and can misinterpret it.
There is a bug or feature request tracker item relating to this.
I get the same error in my client irrespective of whether my server is listening or not, so in this scenario I can not be getting additional data in returned headers as headers are not being returned at all.
Can you connect from a PC using the same jar you are using on the device? Exactly which version of HSQLDB is this?
I am using version 1.8.7. I am connecting with the same jar from client to server. I have since discovered that if I use the hsql:// protocol rather than http:// protocol then all works fine.
If I haven't misinterpreted something, all the problems here are due to the ill-conceived goal stated in the first sentence: "I am trying to connect (from an Android device) to a remote HSQLDB web server…". That just isn't going to work if there is no HSQLDB WebServer running at the destination.
I have verified that if you do this with HyperSQL 2.0, you will not get the misleading messages about arrays and memory, but a proper java.net.ConnectException.
Yes you have misinterpreted what I said. To clarify my last post I have successfully managed to connect a Java app running on an Android phone to a remote server running an HSQLDB web server listening using the "hsql" protocol. However, this does not work when the "http" protocol is used. I am pleased to learn that the misleading errors have gone in version 2.0.
I do not believe what you say. "an HSQLDB web server", a.k.a. org.hsqldb.WebServer (org.hsqldb.server.WebServer in 2.0), serves http protocol, and you can only access it (for JDBC) from external processes by using a jdbc:hsqldb:http: (or https) JDBC URL. I think that you are running a HSQLDB Server, not WebServer.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.