Thanks for the clarification. That explains the time out exceptions and also makes perfect sense using FOR UPDATE.

On 27/02/2013 10:03 PM, Noel Grandin wrote:

Correct. It's the OPTIMISTIC CONCURRENCY strategy applied to database modifications.

It looks like this:

   while (true) {
       generate some changes
       if (nothing else has modified the rows we're interested in) {
          commit changes
           break;
       }
       throw away changes
       if (timed out)
           throw exception;
   }


If I do FOR UPDATE, it gets an exclusive lock (Table level?), so this would block readers and writers. But I'm having trouble thinking of a use case for this.


Sometimes MVCC needs help, or it have trouble making progress on highly contended rows and tables.
Sessions can find themselves stuck in a retry loop for some time.

In particular, our MVCC implementation is not nearly as smart as PostgreSQL or Oracle.



--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to