Locking - Mailing list pgsql-jdbc

From Sacauskis, Mike
Subject Locking
Date
Msg-id 0F35BAEA672CA340974082D0348491E603954717@HQ-EXVS03.anteon.com
Whole thread Raw
List pgsql-jdbc

I’m running into a problem where an "AccessShareLock" is not being released after a select statement unless a connection is closed.  This is leading me to  a deadlock issue with deletes. I’m using JDBC to interact with the database.   I’m using postgresQL 8.0.   I was under the impression that  resources (does this include locks) are released when the prepared statement is closed.  The code snippet looks like the following (though it does more prosessing then in this example.   Is there something that I’m missing to release the locks?

 

          String sql = "select * from testtable";

          PreparedStatement prest = con.prepareStatement(sql);         

          ResultSet rs =  prest.executeQuery();

          rs.next();

          rs.close();

          prest.close();

          con.close();

 

 

pgsql-jdbc by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Problem establishing connection
Next
From: "Jan de Visser"
Date:
Subject: Re: Locking