[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Ref-counting for pristine texts

From: Branko ─îibej <brane_at_xbc.nu>
Date: Fri, 28 Jan 2011 00:59:33 +0100

On 27.01.2011 20:44, Julian Foad wrote:
> My thinking was that if I don't have a lock, I can't safely add a
> reference because another process might delete the text just before I
> get around to executing that statement. But in fact I don't necessarily
> need a WC lock, I need *either* a WC lock *or* a SQL txn. And within
> that lock or txn I need to check the pristine text exists in the store
> before I add the reference.
> To remove a reference, I can't think why I should need a lock or a txn.

Can't be that simple. Every change to the database happens within a
transaction, every transaction can be rolled back in the event of any
kind of error. Consequently, you can only remove a reference (decrease a
reference counter) in such a way that rolling back the transaction in
which that happens can never leave a dangling reference to a deleted
pristine text.

In other words, deleting a pristine text requires an exclusive lock on
the database -- it is a write operation that affects database consistency.

-- Brane
Received on 2011-01-28 01:07:27 CET

This is an archived mail posted to the Subversion Dev mailing list.