0

Having read Does H2 support the serializable isolation level? and the corresponding H2 documentation at http://www.h2database.com/html/advanced.html#transaction_isolation, I'm starting to have some doubts by using H2 -- because it only supports READ_COMMITTED isolation when using MVCC. That, of course, means that it's likely that I sometimes read an inconsistent set of data (other connection updates and commit the read data partially while my connection is reading) that leads to the wrong result/update.

At http://hsqldb.org/doc/guide/guide.html#snc_tx_mvcc one can read that HSQL supports REPEATABLE_READS, and that's equivalent to SERIALIZABLE in their implementation.

Let's assume I want to use SERIALIZABLE isolation in HSQL, where do I have to expect deadlocks/SQL errors due to locking/isolation? Only when writing, or can this also happen for read operations clashing with writes? The database is the data store for a web frontend, and I deem it acceptable when data submissions produce errors, but it's not acceptable at all for regular HTML page reads.

Update (from HSQLDB docs):

With MVCC, when a transaction only reads data, then it will go ahead and complete regardless of what other transactions may do. This does not depend on the transaction being read-only or the isolation modes.

user1050755
  • 11,218
  • 4
  • 45
  • 56
  • Do you still have a question after your update? – Oleg Sep 10 '17 at 17:40
  • The quote from HSQLDB Guide does answer the question. The reads reflect the snapshot of the database (committed transactions) at the point the transaction started. – fredt Sep 16 '17 at 23:37

0 Answers0