Re: Is H2 table locking fair?

2011-09-21 Thread Noel Grandin
Hmm, interesting. I wasn't aware of this so I did some research. The question is discussed here: http://stackoverflow.com/questions/464784/java-reentrantreadwritelocks-how-to-safely-acquire-write-lock And there is an implementation here: http://tutorials.jenkov.com/java-concurrency/read-write-loc

Re: Is H2 table locking fair?

2011-09-20 Thread Thomas Mueller
Hi, > May I ask how it's currently implemented? Wait/notify? Yes. java.util.concurrent can't be used because it doesn't support lock upgrade. Regards, Thomas -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to

Re: Is H2 table locking fair?

2011-09-20 Thread Hendrik Schreiber
On Sep 20, 2011, at 8:09 AM, Thomas Mueller wrote: > Currently, locking is not fair. Thanks, Thomas. May I ask how it's currently implemented? Wait/notify? Thanks, -hendrik -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group

Re: Is H2 table locking fair?

2011-09-19 Thread Thomas Mueller
Hi, Currently, locking is not fair. Regards, Thomas -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@google

Is H2 table locking fair?

2011-09-15 Thread hendrik
Hi, I am wondering whether H2 table locking (not MVCC, but the regular variant) is fair in the sense that, if one transaction locks a table for a while, are other transactions/sessions queued in the order they are trying to attempt to lock the table themselves? So that, when the first

Re: table locking

2010-06-25 Thread Thomas Mueller
Hi, Did you already read the documentation at http://h2database.com/html/advanced.html#transaction_isolation ? The documentation is not complete, I will add: = Read Committed = Read locks are released immediately after executing the statement, but write locks are kept until the transaction commit

Re: table locking

2010-06-24 Thread hendrik
On Jun 23, 12:33 pm, Sergi Vladykin wrote: > > > I assume that once I commit, another waiting connection will be able > > > to obtain the lock. > > > Will it be *any* waiting connection or will it be the connection that > > > has been waiting longest (FIFO)? > > > This one I'm still wondering abou

Re: table locking

2010-06-23 Thread Sergi Vladykin
Hi, On 23 июн, 13:08, hendrik wrote: > On Jun 23, 9:56 am, hendrik wrote: > > > Say, I start a transaction on a table, then select and update some > > stuff on it. For that it will be locked. > > Now my guess is, H2 will only unlock the table once I commit or > > rollback the transaction. > > >

Re: table locking

2010-06-23 Thread hendrik
On Jun 23, 9:56 am, hendrik wrote: > Say, I start a transaction on a table, then select and update some > stuff on it. For that it will be locked. > Now my guess is, H2 will only unlock the table once I commit or > rollback the transaction. > > Correct? Did some more reading.. seems like my assum

table locking

2010-06-23 Thread hendrik
Hi, please excuse the rather general question, but I figured I might as well ask here as I'm using H2. Basically, my question is when are tables locked and unlocked? Say, I start a transaction on a table, then select and update some stuff on it. For that it will be locked. Now my guess is, H2 wi