I see that it is documented. --- Multithreading Support This database is multithreading-safe. That means, if an application is multi-threaded, it does not need to worry about synchronizing access to the database. Internally, most requests to the same database are synchronized. That means an application can use multiple threads that access the same database at the same time, however if one thread executes a long running query, the other threads need to wait. ---
Will setting MULTI_THREADED=1 change this blocking behavior? Are MULTI_THREADED and MVCC permanently incompatible, or there are plans to make them compatible? thanks, mm On Aug 7, 11:32 pm, MarkM <[email protected]> wrote: > Hi H2 people, > Thank you for an excellent DB engine! > > I've found that a long-running query locks another session. Even with > MVCC=TRUE for all sessions. > > Test case: > > create table TEST (id number, name varchar(30), ts timestamp); > > insert into TEST > select X, current_timestamp, current_timestamp from system_range > (1,10000); > > Use MVCC and Autoserver for URL for both sessions > jdbc:h2:~/test;MVCC=TRUE;AUTO_SERVER=TRUE > > -- in session A > select count(*) from TEST,TEST; > > -- in session B > select count(*) from TEST; > > The session B is locked while the session A is running. > > The session B proceeds as soon as A query is finished or canceled. > > If session B gets locked too when it tries to connect during A is > running. > > Same story with MVCC is on or off. > > I do not know if it is a bug or a feature, this behavior is not > described, but it does not seem correct, readers should not lock > readers even in locking mode (not MVCC). > > thanks, > Mark M --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/h2-database?hl=en -~----------~----~----~----~------~----~------~--~---
