I am currently a user of HSQLDB and am trying to upgrade to H2 in
order to better support our integration testing effort.
I have successfully deployed our application using H2, specifying the
following database information:
Driver=org.h2.Driver
url=jdbc:h2:mem:DBSHR
username=sa
password=
Now my goal is to run some integration tests, remotely accessing the
same database from a different JVM. I'm assuming this is possible
from this section of the documentation:
http://www.h2database.com/html/features.html#memory_only_databases
"It is also possible to access a memory-only database remotely (or
from multiple processes in the same machine) using TCP/IP or SSL/TLS.
An example database URL is: jdbc:h2:tcp://localhost/mem:db1 ."
I've tried connecting using the same JDBC configuration:
Driver=org.h2.Driver
url=jdbc:h2:mem:DBSHR
username=sa
password=
That doesn't seem to connect it to the existing database.
I've then tried connecting using the TCP configuration as suggested in
the documentation:
Driver=org.h2.Driver
url=jdbc:h2:tcp://localhost/mem:DBSHR
username=sa
password=
That gives me the following error message:
ERROR: An error occurred while trying to make a connection to
the database:
JDBC URL: jdbc:h2:tcp://localhost/mem:dbshr
Connection
is broken [90067-114]
Is there a step I'm missing?
I'm currently working with H2 version 1.1.114, Spring 2.5.5 and
Hibernate
3.2.6.GA.
I've tried simulating the same functionality using RazorSQL: I opened
one session using the first JDBC settings and then opened a new
instance of RazorSQL, opening another session using the second JDBC
settings. I receive the same error message.
Any assistance you can provide is appreciated!