Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Locking



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();

 

 



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group