java - How do I allow multiple users to connect to my H2 database simultaneously? -


I am using H2 for database management, and this is what I would like to do:

I would like to allow multiple users to access the database at the same time. I have read something about "MULTI_THREADED = TRUE", "LOCK_FILE = NO" and "AUTO_SERVER = TRUE". I have also read that "LOCK_FILE = NO" can be dangerous because I can not really do this because it can corrupt the database, so I'm assuming that there is a bad way to go. I tried to close the connection immediately after reaching the record immediately, whether it was read or written. So far, anything seems to work, the application is not allowing me to read or write from the database if the database has been added in a different example (example: on another computer). Once I completely turn off the application on one computer, I am able to access the database record.

How can I connect more than one user to the H2 database at the same time without compromising the security of the database?

It seems that you are using H2 in embedded mode, which can only be used at one time Allows a database connection. See in the documentation for details.

If you need help with multiple connections, including multiple connection instances, then you need to start H2 instead and use the appropriate for this mode.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -