Hi JS, First of all, there are two storage implementations co-exist in H2, old "PageStore" and a newer one called "MVStore". I won't speak for PageStore, since it's not in active development anymore, but it's concurrency is implemented as lock for the whole tree. BTW, both storages use B-tree, and not B+ tree. MVStore, on the other hand, as it is multi-version storage, does not have any locking at all, because it's modifications are copy-on-write, with non-blocking atomic updates of the tree root reference. Readers always proceed without any locks and see whatever tree version was at the time of tree root reference reading. Writers use optistic concurrency control and retry their operation if concurrent modification is encountered. Only in case of extremely contentious operations, when many update attempts would fail, writers will resort to a tree-wise update lock instead. I hope that at this point you do realize already, that yes, "H2 database is concurrent".
On Sunday, February 21, 2021 at 11:35:10 AM UTC-5 js wrote: > Hi, > I want to improve the locking mechanism in the B+ tree in the H2 database. > But I didn't see any locking mechanism related to B+ Tree nodes in the H2 > database. Hence I want to know whether the B+ tree in the H2 database is > concurrent or not. > > Thank you, > JS > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/470e09f8-b7a9-419f-b4a7-ff8e6dd63bf9n%40googlegroups.com.
