Re: Checking if a table locked from pl/pgsql

Поиск
Список
Период
Сортировка
От Jose Luis LG
Тема Re: Checking if a table locked from pl/pgsql
Дата
Msg-id 001001c1d5a9$4b8d8640$424d4d7d@Servidor2K.local
обсуждение исходный текст
Ответ на Re: Checking if a table locked from pl/pgsql  (Jan Wieck <janwieck@yahoo.com>)
Ответы Re: Checking if a table locked from pl/pgsql  (Jan Wieck <janwieck@yahoo.com>)
Список pgsql-interfaces
In my case I have several clients updating a table at the same time with
each client having several threads updating tables.  With what mechanism
other than locks can you insure for example that at any instant
duplicate keys are not generated?

The lock in the application is released as soon as the thread finishes
work.
Jose

> -----Original Message-----
> From: Jan Wieck [mailto:janwieck@yahoo.com]
> Sent: miércoles, 27 de marzo de 2002 16:37
> To: Hal Davison
> Cc: Jan Wieck; Jose Luis LG; 'PostgreSQL-interfaces'
> Subject: Re: Checking if a table locked from pl/pgsql
>
> Hal Davison wrote:
> >
> > In an operational sense, if a user is updating a table for some
> accounting
> > function then decides to go to lunch leaving the table locked.
>
>     Exactly  what  I  expected.  You have a severe design flaw in
>     your application. Database transactions have to be short  and
>     never  held over actions that could infinitely block, such as
>     user interaction, period!
>
>     You need application  level  advisory  locks.  The  abuse  of
>     database  locks  for  that  will  not  get you very far. Your
>     application will not scale and suffer from problems like  the
>     one you already face.
>
>     Ever   thought   about   adding   a  WEB  interface  to  that
>     application? If a user editing some account needs to  hold  a
>     DB   lock   all  the  time,  you'll  not  implement  it  with
>     Apache/PHP, that's for sure already. And you'll have to  make
>     alot  of  painfull pushups to do it with any other WEB server
>     technology.
>
>
> Jan
>
> >
> > --Hal.
> >
> > ===========================================================
> > Hal Davison                 Internet Petroleum Distribution
> > Davison Consulting                LSE Linux V1.22
> > 6850 Myakka Valley Tr    PostgreSQL 7.03 - Sun Forte - JAVA
> > Sarasota, Florida 34241         Phone: (941) 921-6578
> > http://www.faams.net             FAX: (941) 924-7135
> > ===========================================================
> >
> > On Mon, 25 Mar 2002, Jan Wieck wrote:
> >
> > > Jose Luis LG wrote:
> > > > Hi,
> > > >
> > > > Could anybody tell me if it is posible to check if a if a table
is
> being
> > > > locked from pl/pgsql functions.
> > >
> > >     Yes, it is not.
> > >
> > >     That  you ask for such a functionality leads to the question,
> > >     why can a lock exist long enough that you want  to  check  at
> > >     all?
> > >
> > >
> > > Jan
> > >
> > > --
> > >
> > >
>
#======================================================================#
> > > # It's easier to get forgiveness for being wrong than for being
right.
> #
> > > # Let's break this rule - forgive me.
> #
> > > #==================================================
JanWieck@Yahoo.com
> #
> > >
> > >
> > >
> > > _________________________________________________________
> > > Do You Yahoo!?
> > > Get your free @yahoo.com address at http://mail.yahoo.com
> > >
> > >
> > > ---------------------------(end of
broadcast)-------------------------
> --
> > > TIP 6: Have you searched our list archives?
> > >
> > > http://archives.postgresql.org
> > >
> >
> >
> > ---------------------------(end of
broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo@postgresql.org so that your
> > message can get through to the mailing list cleanly
> >
>
>
> --
>
>
#======================================================================#
> # It's easier to get forgiveness for being wrong than for being right.
#
> # Let's break this rule - forgive me.
#
> #================================================== JanWieck@Yahoo.com
#
>
>
>
>
> _________________________________________________________
>
> Do You Yahoo!?
>
> Get your free @yahoo.com address at http://mail.yahoo.com
>




В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Hal Davison
Дата:
Сообщение: Re: Checking if a table locked from pl/pgsql
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Checking if a table locked from pl/pgsql