Is it possible to use built-in databases (read / write) simultaneously on the same computer (without a server) with different processes. What about simultaneous read / write in a single multi-threaded process?
I am trying to figure out how concurrency is solved in HSQL, H2, Apache Derby and SQLite (via xerial JDBC), but I do not really understand these locking mechanisms (MVCC, OCC, etc.), so I need someone to fixed what i found.
- H2: only one process can be connected to the database, possibly multi-threaded.
- Table level locking for data reading operations does not require locking and can be performed simultaneously with writing (N readers of one record)
- MVCC - lock the level of a table or row for writing (N readers of the same author)
- Hsql: It seems exactly the same as H2, but there are some differences in the MVCC mechanism
- Apache Derby (JavaDB): Only one process can be connected to the database, possibly multi-threaded.
- Table level lock or row level lock for writing. Read operations do not require locking and can be performed simultaneously with writing (N readers of one recording).
- SQLite (xerial JDBC): Several processes can connect at a time, but only one can perform write operations. (database lock).
- When there is write lock, other processes or threads cannot read and write?
source
share