From: | Jaime Casanova <systemguards(at)yahoo(dot)com> |
---|---|
To: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: detectar bloqueo de una fila |
Date: | 2004-08-19 21:24:48 |
Message-ID: | 20040819212448.24215.qmail@web50005.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Hi,
Se supone que el sistema mvcc con el que trabaja
postgres no necesita que *tu* detectes bloqueos de
filas, postgres espera hasta que la fila sea liberada
por la transacción que la este usando para entonces
bloquearla (por supuesto esto asume que no vas a
bloquear una fila mientras esperas ingreso de
información por parte del usuario, imaginate bloquear
una fila y que el usuario decida ir a almorzar sin
haber grabado!!).
Si tu, aun sabiendo que postgres hace esto por ti,
deseas detectar el bloqueo talvez te resulte util la
sugerencia de Josh Berkus a mi me parecio una buena
idea para situaciones en que es *necesario* detectar
el bloqueo:
> Josh Berkus escribio:
>> Merlin,
>> Just as a suggestion: In most of my applications,
>> we have a security layer which is implemented
>> through server-side functions. These functions
>> keep a table updated which contains:
>> lock_table
>> record_id
>> lock_user
>> time_locked
>> This allows us to avoid nasty "your update cannot
>> be processed"-type error messages by showing the
>> user up front which records are locked, as well as
>> allowing the admin to decide when locks
>> should "time out".
>> I tend to find in general that database locking
>> mechanisms are a very poor locking strategy for a
>> good UI.
>> Josh Berkus
>> josh(at)agliodbs(dot)com
>> Aglio Database Solutions
>> San Francisco
Atentamente,
Jaime Casanova
_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Jesus Gustavo Macias Barba | 2004-08-19 23:01:32 | Re: definicion de variables en funciones.- |
Previous Message | Estéfano Castillo | 2004-08-19 20:57:18 | Re: definicion de variables en funciones.- |