LOCK TABLE syntax doesn't work with H2

44 views
Skip to first unread message

Bruce Visscher

unread,
May 8, 2024, 3:38:10 PMMay 8
to H2 Database
On stack overflow, Thomas Mueller wrote:

 I'm one of the authors of H2. If something doesn't work, please post it on the H2 mailing list.

Is this the H2 mailing list?

The Oracle lock table statement doesn't work in H2.  The suggested select...for update alternative doesn't accomplish the same thing.  Specifically, if the table is empty it will not prevent other processes or threads from performing queries and inserting rows into the table.

Noel Grandin

unread,
May 9, 2024, 2:49:58 AMMay 9
to h2-da...@googlegroups.com


On 5/8/2024 6:31 PM, Bruce Visscher wrote:
> On stack overflow, Thomas Mueller <https://stackoverflow.com/users/382763/thomas-muelle> wrote:
>
> The Oracle lock table statement doesn't work in H2.  The suggested select...for update
> <https://stackoverflow.com/a/71210443/3604905> alternative doesn't accomplish the same thing.  Specifically, if the
> table is empty it will not prevent other processes or threads from performing queries and inserting rows into the table.
>

We do not ly have an equivalent of that, the only alternative we have is putting the whole db into exclusive mode
temporarily
https://h2database.com/html/commands.html#set_exclusive
Reply all
Reply to author
Forward
0 new messages