Re: strange (maybe) behaviour of table lock - Mailing list pgsql-general

From Tom Lane
Subject Re: strange (maybe) behaviour of table lock
Date
Msg-id 20278.1165604477@sss.pgh.pa.us
Whole thread Raw
In response to Re: strange (maybe) behaviour of table lock  (Edoardo Panfili <edoardo@aspix.it>)
Responses Re: strange (maybe) behaviour of table lock  (Edoardo Panfili <edoardo@aspix.it>)
List pgsql-general
Edoardo Panfili <edoardo@aspix.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

pgsql-general by date:

Previous
From: Edoardo Panfili
Date:
Subject: Re: strange (maybe) behaviour of table lock
Next
From: "Matthew T. O'Connor"
Date:
Subject: Re: Performance figures from DbMail list