agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Gerry Stringer <[email protected]>
To: [email protected]
Subject: Re deadlock ( bug in begin/end? replace?)
Date: Tue, 27 Apr 93 05:15:47 -0700
Message-ID: <[email protected]> (raw)



I've been watching the mail over the last couple of days but still
haven't seen a definitive answer to avoiding deadlock. If:

>a replace query of the form:  
> 
>       replace foo (attribute1 =foo.attribute1 + 1) 
> 
>will first do a scan over foo (acquiring a readlock) then attempt to 
>write a new instance/row/tuple (acquiring a write lock).  any time you 
>"upgrade" a read lock to a write lock you're vulnerable to deadlock.

then how do I code a transaction that is guaranteed not to deadlock?
Would a dummy append do it or should I be considering my own locking
outside Postgres?

	thanks,
		gerry


+--------------------------------+---------------------------------+
|Gerry Stringer                  |Phone: +44 954 780926            |
|Cambridge Scanning Company Ltd  |Fax:   +44 954 789829            |
|Saxon Way                       |UUCP : [email protected]       |
|Bar Hill                        |       [email protected]        |
|Cambridge CB3 8SL               |       			   |
|United Kingdom                  |                                 |
+--------------------------------+---------------------------------+





reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Re deadlock ( bug in begin/end? replace?)
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox