concurrent queries

41 views
Skip to first unread message

Olaf van der Meer

unread,
Mar 12, 2024, 9:09:12 AMMar 12
to H2 Database
Hi,

I am using H2 1.4. Is it correct that H2 can execute only one query at the time on the same table/database?

We see that concurrent queries (on the same database, same table) are waiting on each other.
As long as a (long running) query is busy, the h2 engine does not execute another query on the same database.

Is this observation correct, or is our code not correct for this situation.

thanks in advance,

Olaf

Evgenij Ryazanov

unread,
Mar 12, 2024, 9:41:21 AMMar 12
to H2 Database
Hi!

All 1.*.* versions of H2 are entirely outdated and aren't supported in any way.

1. H2 1.4.* has two different storage engines.
2. H2 1.4.199 and older versions have different synchronization models for every engine (1.4.200 uses multi-threaded mode for MVStore and single-threaded mode for PageStore unconditionally).
3. H2 1.4.197 and older versions can use either table-level locks or row-levels locks when legacy PageStore engine is used (since 1.4.198 PageStore uses table-level locks unconditionally).

So possibility of concurrent execution depends on your setup. Most likely you use a legacy PageStore engine and therefore database works in single-threaded mode with table-level locks.
Reply all
Reply to author
Forward
0 new messages