[ https://issues.apache.org/jira/browse/DERBY-3404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12570758#action_12570758 ]
Mamta A. Satoor commented on DERBY-3404: ---------------------------------------- Thanks for working on this issue, Knut. While working on DERBY-3304, I have a need to know if JDBC Resultset is closed but not just by checking the EmbedResultset but also the underlying language resultset. I made a temporary code change in my codeline to do this check myself only in the area of the code where I need this check and my test case now works as expected. So, I would love to see a fix for DERBY-3404 checked in to make sure that it will make the test case run without my temporary change for language resultset close check. > EmbedResultSet.getString() returns wrong value after auto-commit with > CLOSE_CURSORS_AT_COMMIT > --------------------------------------------------------------------------------------------- > > Key: DERBY-3404 > URL: https://issues.apache.org/jira/browse/DERBY-3404 > Project: Derby > Issue Type: Bug > Affects Versions: 10.3.1.4, 10.3.2.1, 10.4.0.0 > Reporter: Knut Anders Hatlen > Assignee: Knut Anders Hatlen > Priority: Minor > Attachments: CloseOnCommit.java, d3404-v1.diff, d3404-v1.stat > > > The following code prints "null" to the console with the embedded driver: > Statement s = c.createStatement(ResultSet.TYPE_FORWARD_ONLY, > ResultSet.CONCUR_READ_ONLY, > ResultSet.CLOSE_CURSORS_AT_COMMIT); > ResultSet rs = s.executeQuery("select * from sysibm.sysdummy1"); > rs.next(); > c.createStatement().executeQuery("values 1").close(); // causes > auto-commit > System.out.println(rs.getString(1)); > The call to rs.getString() should perhaps have thrown SQLException, since the > auto-commit between next() and getString() should close the ResultSet when > the holdability is CLOSE_CURSORS_AT_COMMIT, I think. Anyway, the value stored > in SYSIBM.SYSDUMMY1 is 'Y' and not NULL, so it should definitely not return > null. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.