Re: [h2] SELECT.. FOR UPDATE (to lock a row) followed by closing the connection leaves the row lock around

2016-01-28 Thread Noel Grandin

thanks for the bug report, this has been fixed on master/trunk

--
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] SELECT.. FOR UPDATE (to lock a row) followed by closing the connection leaves the row lock around

2016-01-28 Thread Martin Lichtin
That was fast, thanks Noel.
In the mean time however I'm no longer so certain about my observation :)
As I use connection pooling, doesn't the close() become a no-op (it never 
reaches the H2 server).
So I still need either a commit or rollback to complete the transaction 
before returning the connection back to the pool...

On Thursday, January 28, 2016 at 9:38:28 AM UTC+1, Noel Grandin wrote:
>
> thanks for the bug report, this has been fixed on master/trunk 
>

-- 
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] SELECT.. FOR UPDATE (to lock a row) followed by closing the connection leaves the row lock around

2016-01-28 Thread Noel Grandin

A good connection pool is supposed to issue a rollback() call before recycling 
the connection.
But not all of them do, in the name of performance.

--
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] SELECT.. FOR UPDATE (to lock a row) followed by closing the connection leaves the row lock around

2016-01-26 Thread Martin Lichtin
As the subject says, I'm doing a SELECT.. FOR UPDATE to lock a row.

Sometimes this is followed by an UPDATE, sometimes not. 
In the case of an UPDATE, I commit() the connection which releases the 
lock. All fine.

When not updating the row contents, I close() the connection. This however 
seems to leave the row lock around.
I can, also in this case, call either commit() or rollback() before the 
close(), then the lock is released.
But why would I be required to do this? Closing a connection (whether 
voluntarily or due to a networking issue) should cleanup its resources as 
well (e.g. locks).

- Martin

-- 
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.