pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Rokohl <rokohl@raygina.de>
To: Merlin Moncure <merlin.moncure@rcsonline.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: lock - feedback
Date: Wed, 12 Oct 2005 15:38:16 +0000
Message-ID: <434D2DE8.5050700@raygina.de> (raw)
In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB3417DD593@Herge.rcsinc.local>
References: <6EE64EF3AB31D5448D0007DD34EEB3417DD593@Herge.rcsinc.local>

Merlin Moncure wrote:
> There is no 100% correct answer to this problem.  However, you are
> thinking in terms of pessimistic locking (like most people do), so by
> all means use it.
>
> By 'lost update' problem, I assume you mean
> user A reads
> user B reads
> user A writes
> user B writes <-- overwrites user A's changes
>
> I suggest you read up on locking strategies.  Pessimistic is the easiest
> way to solve this problem but rarely the best way.  Worst problem here
> is you are blocking on reads which (drastically) lowers concurrency and
> forces your app to be prepared to handle read failures...this can be a
> huge headache.
>
> Pure optimistic locking (in example above) is obviously not suitable in
> multi user applications if you care about your data.  However, you could
> use timestamps + assertions to throw an error during an update if you
> are out of synch with the server here.  The major difference here is
> that you are making user aware of problem when it happens, not when your
> app thinks it might happen.  This type of lock resolution can be made
> via rules, triggers, or a specialized dynamic sql procedure to resolve
> the record.
>
> also, this is off-topic for odbc list :)
>
> merlin
>
>
>   
sure it is big problem, but i think you can solve it with different 
locking types. 
if you have a write look and no read looks it should work.
i mean if you never ban the reading of the data but you guarantee with 
write locks
than only one user can have a record in write-mode everything is fine 
and nothing is slow.
and this is the point where i want to pop up a dialog with the message 
that someone else edit the record yet.








view thread (14+ messages)  latest in thread

Message-ID: <434D2DE8.5050700@raygina.de>
Permalink:  ../434D2DE8.5050700@raygina.de/
Also on:    postgresql.org/message-id/434D2DE8.5050700@raygina.de

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: rokohl@raygina.de, merlin.moncure@rcsonline.com
  Subject: Re: lock - feedback
  In-Reply-To: <434D2DE8.5050700@raygina.de>
  References: <6EE64EF3AB31D5448D0007DD34EEB3417DD593@Herge.rcsinc.local> <434D2DE8.5050700@raygina.de>

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

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