Issue Details (XML | Word | Printable)

Key: DERBY-3404
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Knut Anders Hatlen
Reporter: Knut Anders Hatlen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

EmbedResultSet.getString() returns wrong value after auto-commit with CLOSE_CURSORS_AT_COMMIT

Created: 11/Feb/08 03:05 PM   Updated: 30/Jun/09 03:55 PM
Return to search
Component/s: JDBC
Affects Version/s: 10.3.1.4, 10.3.2.1, 10.4.1.3
Fix Version/s: 10.3.3.0, 10.4.1.3

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works CloseOnCommit.java 2008-02-11 03:06 PM Knut Anders Hatlen 0.7 kB
File Licensed for inclusion in ASF works d3404-v1.diff 2008-02-14 01:30 PM Knut Anders Hatlen 7 kB
File Licensed for inclusion in ASF works d3404-v1.stat 2008-02-14 01:30 PM Knut Anders Hatlen 0.5 kB

Bug behavior facts: Regression
Resolution Date: 05/Mar/08 06:13 AM


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.