Yeah, I've read that one a few times. It doesn't really explain a lot of detail. It only says

"Note, however, that the write transaction does need to use locks"

I was just having a dumb moment... I mean what is the point of FOR UPDATE if it doesn't get a lock?

The H2 Documentation says

"When using MVCC in this database, delete, insert and update operations will only issue a shared lock on the table. An exclusive lock is still used when adding or removing columns, when dropping the table, and when using SELECT ... FOR UPDATE"

So just to clarify my understanding. I can update / insert / delete in MVCC without getting exclusive locks, so really it doesn't block other writers, and still ensures transaction isolation. ?

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.


Thanks, Ryan





On 27/02/2013 4:49 PM, Noel Grandin wrote:

On 2013-02-27 10:19, Ryan How wrote:
This doesn't really help, but I thought the idea of MVCC is to be an optimistic lock?. So by definition it shouldn't be able to timeout as it doesn't even need to get a "lock" ? Or am I grossly misunderstanding something here? Does "FOR UPDATE" still lock a table for other "writers", it just doesn't lock it for other "readers" ?

Try reading about MVCC first.
http://en.wikipedia.org/wiki/Multiversion_concurrency_control



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