| 
 | 
I have a program that has pretty simple process of establishing a JDBC connection, opening up a recordset with a simple select statement (prepared) and then closing the recordset and closing the statement like so:
         PreparedStatement ps = conn.prepareStatement(query);
         ResultSet rs = ps.executeQuery();        
         for (int i = 0; i < 2; i++) {
             if (rs.next())
                 System.out.println(rs.getString(1));           
         }        
         try {
             rs.close();
             ps.close();
             ps = null;
             rs = null;
         }
         catch (SQLException ex){
             ex.printStackTrace();
         }
All is well.  The file that was opened in the query is now unlocked.  
Things are OK.
But if I run the same query again, when I execute the try block, closing the recordset and statement , without closing the connection, the file I opened in the select statement is now locked. Work with job locks show the following on the file:
\
                      Object                      Member
Object      Library     Type       Lock     Status  Locks
PGNL601     FMSMICF     *FILE-PHY  *SHRRD    HELD    YES
So I am wondering is JT400 holding a lock on the file assuming that it 
will be accessed again?  Is this a bug?  A configuration issue?
Any ideas? Pete Helgren
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.