title: DB2 locks stay forever
body: <p>I have an application connecting to DB2 10.5. Issuing selects and loading data from the DB. Data is in the range of 200 to 400k records for different tables.
  Towards the end of the DB load activity(the process is still alive, but DB load is complete), when I run the command to check for locks. I see a bunch of locks (largely shared) associated to some of these tables and they continue to exist, till I kill the client processes.</p>
  
  <p>I am using jdbc to connected and load from DB2. Another thing I did, was enabled trace on DB2 to check for the SQL's running. One interesting thing observed was, for some of the tables, I did not see a "Close" operation on the cursor.
  For most of the queries I saw, "Prepare", "Describe", "Open" and "Close" happening in that order, but for some of the tables, I did not see "Close" event.</p>
  
  <p>I create connections with auto-commit=false. So, I tried issuing a manual commit through client code, post every query, but that hasn't helped either. Moreover, these are plain select queries. So not sure why this should happen.</p>
  
  <p>More,
  Specific question based on the comments - Why do I see locks pending for Select queries, even after their execution has completed? They are released only when i kill the client application.</p>
  
  <p>Details around the implementation - Using a connection pool, with connections created with autocommit=false. For every query, the sequence being, take from the pool, execute the query and return to the pool. So in essence the connections continue to be alive.</p>
  
  <p>TIA,
  Vicky</p>