Re: strange (maybe) behaviour of table lock

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Edoardo Panfili <edoardo(at)aspix(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: strange (maybe) behaviour of table lock
Date: 2006-12-08 19:01:17
Message-ID: 20278.1165604477@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Edoardo Panfili <edoardo(at)aspix(dot)it> writes:
> It seems that if I put some delay between calls to the servlet all goes
> well. I can change lock level but ther is something wrong.

> Obviously I am doiung something wrong. To unlock the tables is not
> sufficient close the Statement and the Connection?

Um, possibly not, if you're using connection-pooling software ... and
even if you're not, I think closing the connection is asynchronous;
it'd be possible to establish a new connection before the old one has
terminated and released its locks.

Rather than closing the connection, I think you need to do something
explicit to commit your transaction.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2006-12-08 19:04:59 Re: Male/female
Previous Message Edoardo Panfili 2006-12-08 18:47:18 Re: strange (maybe) behaviour of table lock