db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3404) EmbedResultSet.getString() returns wrong value after auto-commit with CLOSE_CURSORS_AT_COMMIT
Date Fri, 15 Feb 2008 08:25:07 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569204#action_12569204

Knut Anders Hatlen commented on DERBY-3404:

There was one failure in the JDBC 4 tests with the patch:

1) testAutoCommitFailure(org.apache.derbyTesting.functionTests.tests.jdbc4.TestDbMetaData)junit.framework.AssertionFailedError:
autoCommitFailureClosesAllResultSets() returned value which doesn't match actual behaviour.
expected:<true> but was:<false>
	at org.apache.derbyTesting.functionTests.tests.jdbc4.TestDbMetaData.testAutoCommitFailure(TestDbMetaData.java:492)

> 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:,,
>            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.

View raw message