You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kathey Marsden (JIRA)" <ji...@apache.org> on 2007/04/18 20:08:15 UTC
[jira] Commented: (DERBY-2517) convert lang/forupdate.sql to junit
[ https://issues.apache.org/jira/browse/DERBY-2517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489840 ]
Kathey Marsden commented on DERBY-2517:
---------------------------------------
Thanks Raman for the patch.
I have not seen the stmt and connection set as instance variables. Typically I see each fixture call getConnection or createStatement as needed. I don't know if this is a problem, but just something I noticed.
With the new patch can you also submit a file with the stat output?
The issue with the delete statement is because the cursor C4 is closed, first by JDBC.assertSingleValueResultSet(rs, "1"); and then again by rs.close(). The following edits should make it pass.
public void testUpdates2() throws SQLException {
stmt.executeUpdate("insert into t1 (i) values (1)");
stmt.setCursorName("C4");
ResultSet rs = stmt.executeQuery("select i from t1 s1 for update");
rs.next();
Statement stmt2 = createStatement();
try {
stmt2.executeUpdate("delete from s1 where current of C4");
fail("ForUpdateTest: should have thrown exception");
} catch (SQLException e) {
assertSQLState("42X28", e);
}
Statement stmt3 = createStatement();
stmt3.executeUpdate("delete from t1 where current of C4");
stmt3.executeUpdate("delete from t1");
rs.close();
...
Thanks
Kathey
> convert lang/forupdate.sql to junit
> ------------------------------------
>
> Key: DERBY-2517
> URL: https://issues.apache.org/jira/browse/DERBY-2517
> Project: Derby
> Issue Type: Test
> Components: Test
> Reporter: Ramandeep Kaur
> Assigned To: Ramandeep Kaur
> Priority: Minor
> Fix For: 10.3.0.0
>
> Attachments: DERBY-2517.diff
>
>
> convert lang/forupdate.sql to junit
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.