"Connection is broken" with ...

Tim
2010-05-21
2014-01-19
  • Tim

    Tim - 2010-05-21

    I am trying to connect (from an Android device) to a remote HSQLDB web server using:

    DriverManager.getConnection("jdbc:hsqldb:http://remoteserveripaddress:port","user","pwd")

    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.

     
  • Fred Toussi

    Fred Toussi - 2010-05-21

    The client does not use much memory. It may be something specific to the JVM in the Android device.

     
  • Tim

    Tim - 2010-05-22

    Fred,

    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?

    Regards,

    Tim.
    My Android FreeMemory is 1355832, MaxMemory is 16777216, TotalMemory is 5185504

     
  • Fred Toussi

    Fred Toussi - 2010-05-23

    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.

     
  • Fred Toussi

    Fred Toussi - 2010-05-25

    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.

     
  • Tim

    Tim - 2010-05-29

    Fred,

    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.

    Regards,

    Tim.

     
  • Fred Toussi

    Fred Toussi - 2010-05-29

    Can you connect from a PC using the same jar you are using on the device? Exactly which version of HSQLDB is this?

     
  • Tim

    Tim - 2010-06-05

    Fred,

    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.

    Regards,

    Tim.

     
  • Blaine Simpson

    Blaine Simpson - 2010-06-05

    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.

     
  • Tim

    Tim - 2010-06-06

    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.

     
  • Blaine Simpson

    Blaine Simpson - 2010-06-08

    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.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks