db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dyre Tjeldvoll (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3404) EmbedResultSet.getString() returns wrong value after auto-commit with CLOSE_CURSORS_AT_COMMIT
Date Wed, 13 Feb 2008 18:07:26 GMT

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

Dyre Tjeldvoll commented on DERBY-3404:
---------------------------------------

Great. Fwiw, her is the call stack showing where the value is changed from "Y" to null:

(dbx) where
=>[1] org.apache.derby.iapi.types.SQLChar.restoreToNull(this = <OBJECT>)  "SQLChar.java":838
  [2] org.apache.derby.iapi.types.DataType.recycle(this = <OBJECT>)  "DataType.java":254
  [3] org.apache.derby.impl.sql.execute.ValueRow.resetRowArray(this = <OBJECT>)  "ValueRow.java":179
  [4] org.apache.derby.impl.sql.execute.ScanResultSet.close(this = <OBJECT>)  "ScanResultSet.java":237
  [5] org.apache.derby.impl.sql.execute.TableScanResultSet.close(this = <OBJECT>)  "TableScanResultSet.java":796
  [6] org.apache.derby.impl.sql.execute.BulkTableScanResultSet.close(this = <OBJECT>)
 "BulkTableScanResultSet.java":348
  [7] org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.endTransactionActivationHandling(this
= <OBJECT>, forRollback = false)  "GenericLanguageConnectionContext.java":2766
  [8] org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.doCommit(this = <OBJECT>,
commitStore = true, sync = true, commitflag = 0, requestedByUser = true)  "GenericLanguageConnectionContext.java":1125
  [9] org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.userCommit(this = <OBJECT>)
 "GenericLanguageConnectionContext.java":1003
  [10] org.apache.derby.impl.jdbc.TransactionResourceImpl.commit(this = <OBJECT>)  "TransactionResourceImpl.java":237
  [11] org.apache.derby.impl.jdbc.EmbedConnection.commit(this = <OBJECT>)  "EmbedConnection.java":1482
  [12] CloseOnCommit.main(args = <ARRAY>)  "CloseOnCommit.java":14
(dbx) 

So I guess one of the calls to XResultSet.close() that were added in DERBY-827 is causing
the regression (as you guessed)

> 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
>            Priority: Minor
>         Attachments: CloseOnCommit.java
>
>
> 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.


Mime
View raw message