Xavier Marquis
Xavier Marquis

Reputation: 41

h2 server mode or mixed mode : data are updated from app1 but not visible from app2

I'm new to h2, but I read a lot of documentation, I successfully created embeded H2 mem or file database.

But I'm still not able to use server mode or mixed mode :

I launch my Web server and tcp server like this :

java -jar h2-1.4.196.jar -web -webAllowOthers -tcp -tcpAllowOthers -browser -tcpPort 9092

Trying server mode :

I create file database like this :

Database is created, and I see a lock file

--> When I launch my java application properties file, it stays sticked at the phase of datasource creation. I tried to change url: jdbc:h2:tcp://localhost:9092/~/maBaseH2FichierTCP to jdbc:h2:tcp://localhost/~/maBaseH2FichierTCP, but no effect.

Trying mixed mode :

--> Behaviour is the same, application start, but when at datasource creation, it waits, and nothing more happen ...

Does someone take has a idea to make one of orther server mode work ?

Upvotes: 0

Views: 437

Answers (1)

Xavier Marquis
Xavier Marquis

Reputation: 41

I solved this first problem : It was caused by a incompatibility between h2 version of h2 console, and my h2 client in application. 1.4.196 vs 1.4.192; when debuging, we can see an exception is launched, but nothing is writen on debug or even trace I think, and programme try to execute a rollback on a connection. It ended in a infinite loop here, even if I don't understand why. When changing version, I can connect my remote base.

Howerver now, when application update the database, the updated data cannot been seen in h2 console. Does someone know why ?

Upvotes: 0

Related Questions