db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øystein Grøvlen <Oystein.Grov...@Sun.COM>
Subject Re: [jira] Created: (DERBY-3098) LOB locks are not released after free().
Date Wed, 03 Oct 2007 17:14:43 GMT
Bryan Pendleton wrote:


> Or, are you saying that the JDBC semantics are that my application
> can navigate away from the base record, and if I am using, say,
> READ COMMITTED isolation level, then the lock on the base record is
> then released, but the lock on the Blob/Clob is supposed to be
> retained until either:
>  - the transaction is committed/rolled back, or
>  - my application calls Blob.free()

That is correct.  When you do a getBlob() on a result set, the 
value/content of this Blob object should not change during the lifetime 
of the object.  If the Blob is small, the value will be cached in memory 
and the underlying row will be allowed to change.  If the Blob is large, 
the Blob is not cached, and the underlying row is locked to prevent the 
Blob from changing.

> Does that mean that another transaction could succeed in locking
> the base record, but be unable to access the Blob/Clob because it
> was still locked by my original transaction?

It is the base record that is locked in both cases.  Hence, if there is 
an active Blob object for a Blob column of a record, no other 
transaction may update any column of the record.  (Note that read access 
is allowed.)


View raw message