I want to acquire a lock on the whole database for a moment in order
to perform a couple of operations in atomic fashion. That is,

    synchronized(???) {
        performACoupleOfOperationsAtomically();
    }

Which lock does H2 use internally to guard its state? I should
obviously use the same lock here.

If there's no way to acquire H2's internal lock this way, are there
some SQL commands that would do essentially the same thing, something
like:

    conn.getStatement().execute("ACQUIRE LOCK FOR THE CALLING
THREAD");
    performACoupleOfOperationsAtomically();
    conn.getStatement().execute("RELEASE THE LOCK");

Best Regards,
Joonas

-- 
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.

Reply via email to