Re: data integrity

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Jelle Ouwerkerk <jelle(at)openface(dot)ca>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: data integrity
Date: 2001-11-06 15:13:34
Message-ID: Pine.LNX.4.33L2.0111061209170.10588-100000@aguila.protecne.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 5 Nov 2001, Jelle Ouwerkerk wrote:

> Problem: How are people dealing with data integrity issues such as stale
> data when writing web-based apps? For instance:
[...]

> In some scenarios, user B should be prevented from updating.

Maybe you can do something like this:

user A SELECTs the data, and the web app caches the fields.
user B does the same thing.
user B changes some fields and commits.
user A changes some fields and tries to commit. His webapp SELECTs the
data again and checks against its cache.
Since the data is different, the webapp presents him the three versions
and lets him choose.

The idea is to check every time you are going to commit the data to see
if it changed while you weren't looking. If it did, tell him so and let
him decide.

--
Alvaro Herrera (<alvherre[(at)]atentus(dot)com>)
"Ni aun el genio muy grande llegaria muy lejos
si tuviera que sacarlo todo de su propio interior" (Goethe)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andy Hallam 2001-11-06 15:38:22 ODBC and Native error codes
Previous Message David Link 2001-11-06 14:52:56 self outer join