Re: Transaction-scope advisory locks

Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>

From: Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Szymon Guz <mabewlun@gmail.com>, pgsql-hackers@postgresql.org
Date: 2010-12-14T21:05:53Z
Lists: pgsql-hackers
On 2010-12-14 7:05 PM +0200, Tom Lane wrote:
> Marko Tiikkaja<marko.tiikkaja@cs.helsinki.fi>  writes:
>> On 2010-12-14 4:23 AM +0200, Tom Lane wrote:
>>> Uh, I don't think so.  It sure looks like you have changed the user
>>> lockmethod to be transactional, ie, auto-release on commit/abort.
>
>> I was under the impression that passing sessionLock=true to
>> LockAcquire(), combined with allLocks=false to LockReleaseAll() would be
>> enough to prevent that from happening.  My tests seem to agree with this.
>
>> Am I missing something?
>
> All the places that look at LockMethodData->transactional ?

As far as I can tell, every code path that looks at 
LockMethodData->transactional either has an explicit sessionLock boolean 
or looks whether owner == NULL to actually check whether the lock in 
question is a session lock or not instead of blindly trusting 
->transactional.


Regards,
Marko Tiikkaja