I really like idea behind H2 automatic mixed mode of operation - 
which lets to use physical database file reference (which is 
easily understood and easily interpreted by everyone) instead
of more "abstract" connector to some database server one has to maintain.

However, this mode assumes kind of symmetry between clients - 
any of them can be blessed with in-process server.
I think usually this is not the real case; even documentation
says that "the main application should open the database first if possible."

I think in many cases, one would actually like to stick database server
to main application process. One might say - ok then - you can just 
explicitly start server in main application, and use remote connections 
from other
processes. But this retracts one of really nice features 
of automatic mixed mode - the automatic selection of port and propagation
of that information to other clients meant to connect to same database.
Another problem is different connection string on main application and on 
remote
processes.

I'm thinking about connection mode where:
- main application is started with [jdbc:h2:/data/test;SERVER=TRUE]
- it spawns server, writing down socket details into lock file
- client application is started with [jdbc:h2:/data/test;CLIENT=TRUE]
- it uses tcp connection to database server as specified in the lock file

This could event be implemented on top of AUTO_SERVER mode with additional 
flag which would say "do not let auto db server migrate to this process".

Anyone tried to implement such behavior? Maybe this is already possible and
I overlooked this in docs?

marcin

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to