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-2994) Open cursor is not functioning as expected when used with Rename Table
Date Mon, 13 Aug 2007 11:23:43 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519415
] 

Knut Anders Hatlen commented on DERBY-2994:
-------------------------------------------

Do you get the expected exception if you replace the
assertStatementError() line with
  assertStatementError("X0X95", createStatement(), "rename table t2 to fake");
?

Since the same statement that was used to open the cursor, was passed
as an argument to assertStatementError(), the cursor is closed when
assertStatementError() calls Statement.execute().

>From java.sql.Statement's javadoc:

  By default, only one ResultSet object per Statement object can be
  open at the same time. Therefore, if the reading of one ResultSet
  object is interleaved with the reading of another, each must have
  been generated by different Statement objects. All execution methods
  in the Statement interface implicitly close a statment's current
  ResultSet object if an open one exists.

> Open cursor is not functioning as expected when used with Rename Table 
> -----------------------------------------------------------------------
>
>                 Key: DERBY-2994
>                 URL: https://issues.apache.org/jira/browse/DERBY-2994
>             Project: Derby
>          Issue Type: Bug
>          Components: Miscellaneous
>    Affects Versions: 10.3.1.1
>            Reporter: Ravinder Reddy
>             Fix For: 10.3.1.1
>
>
> In the context of following scenario  
> public void testRenameOpenCursoredTable() throws SQLException {
>         Statement s = createStatement(ResultSet.TYPE_FORWARD_ONLY ,   ResultSet.CONCUR_UPDATABLE);
>         assertUpdateCount(s , 0 , "create table t2(c21 int not null primary key)");
>         assertUpdateCount(s , 1 , "insert into t2 values(21)");
>         assertUpdateCount(s , 1 , "insert into t2 values(22)");
>         ResultSet rs = s.executeQuery("select * from t2");
>         rs.next();
>         assertStatementError("X0X95" , s , "rename table t2 to fake");
> }
>      I am expecting an open cursor and asserting the last Statement to throw an Exception(with
SQLState "X0X95") .But  the cursor was not opened at the last statement as the statement was
executed successfully without any Exceptions.

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