Re: Checking if a table locked from pl/pgsql

From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: Hal Davison <hal(at)faams(dot)net>
Cc: Jan Wieck <janwieck(at)yahoo(dot)com>, Jose Luis LG <jlopezgonz(at)terra(dot)es>, "'PostgreSQL-interfaces'" <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: Checking if a table locked from pl/pgsql
Date: 2002-03-27 15:36:39
Message-ID: 200203271536.g2RFadv27182@saturn.janwieck.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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(at)Yahoo(dot)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(at)postgresql(dot)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(at)Yahoo(dot)com #

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Hal Davison 2002-03-27 15:45:51 Re: Checking if a table locked from pl/pgsql
Previous Message Hal Davison 2002-03-27 12:24:17 Re: Checking if a table locked from pl/pgsql