db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2517) convert lang/forupdate.sql to junit
Date Wed, 18 Apr 2007 18:08:15 GMT

    [ 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)");
		ResultSet rs = stmt.executeQuery("select i from t1 s1 for update");
		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");




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

View raw message