Hi, I'm afraid the only thing I can do currently is to improve the documentation. H2 does not currently support using different transaction isolation levels for different connections.
With the MVStore + TransactionStore combination, hopefully this restriction can be removed in the future, but right now this is not a priority (first, the MVStore needs to get stable). Regards, Thomas On Sunday, September 14, 2014, Gili <[email protected]> wrote: > Hi, > > I just spent two days tracking down a race condition that ended up being > caused by a H2 "feature". > > It seems that when one thread invokes Connection.setTransactionIsolation() > it affects all other connections. It turns out that invoking this method > invokes "SET LOCK_MODE" under the hood and according to > http://www.h2database.com/html/grammar.html#set_lock_mode "This setting > affects all connections." > > Thomas and Noel, I believe this behavior violates the JDBC specification > (which states the method affects the current connection, no mention of the > entire database)... but even if it does not, it causes me major grief. Most > methods of my application require READ_COMMITTED but update operations > require REPEATABLE_READ and insert operations require SERIALIZABLE. This > behavior forces me to upgrade all connections to SERIALIZABLE which makes > the service unusable in production. > > Seeing as you are working on MVCC, is this something you could fix in the > near future? > > Thanks, > Gili > > -- > 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] > <javascript:_e(%7B%7D,'cvml','h2-database%[email protected]');> > . > To post to this group, send email to [email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>. > Visit this group at http://groups.google.com/group/h2-database. > For more options, visit https://groups.google.com/d/optout. > -- 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 http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
