Kathey Marsden created OPENJPA-2329:
---------------------------------------

             Summary: OpenJPA should close JDBC metadata (and all) statements 
                 Key: OPENJPA-2329
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2329
             Project: OpenJPA
          Issue Type: Bug
          Components: jpa
         Environment: SuSE linux vm loaded to the point that garbage collection 
not likely to kick in
            Reporter: Kathey Marsden


Please close all JDBC Metadata statements after execution  in OpenJPA to avoid 
a potential interaction issue with Derby Network Client.  See details at: 
https://issues.apache.org/jira/browse/DERBY-6055.

The statement can be obtained with ResultSet.getStatement() e.g.

      for (int i = 0; i < 50000; i++) {
                ResultSet rs = conn.getMetaData().getSchemas();
                while (rs.next()) {
                    //System.out.println("SCHEM NAME = " + rs.getString(1));
                }
                rs.getStatement().close();  <====
            } 



In debugging a recent DERBY client/OpenJPA interaction issue, I saw in  that  
there were a fair number of JDBC metadata Result Sets that  did not get cleaned 
up until garbage collection kicked in. 

There is a program in-lined in  the description of DERBY-6055 that shows how 
metadata statements can build up and could potentially exceed the maximum 
number of sections if garbage collection did not kick in on time on a loaded 
system. 

Sorry for the lack of OpenJPA version detail and repro as I don't have any 
personal experience with OpenJPA and was not able to get information on OpenJPA 
version from the user.  The user's primary statement issue was a different so 
they did not have time to follow up on this potential one.





--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to