db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1183) Client java.sql.ResultSet.getCursorName() does not return the correct cursor name for Statements after the first execution
Date Tue, 20 Jun 2006 12:14:31 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1183?page=comments#action_12416892 ] 

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

Dag, I see two failures in derbyall with this patch. From
lang/updatableResultSet.java I got a diff that was thousands of lines
long, but the relevant part seemed to be

********* Diff file derbyall/derbynetclientmats/DerbyNetClient/derbynetmats/derbynetmats/updatableResultSet.diff
*** Start: updatableResultSet jdk1.5.0_04 DerbyNetClient derbynetmats:derbynetmats 2006-06-20
12:16:49 ***
[snip]
4778a137,138
> FAIL: exception thrown:
> ERROR XJ114: Invalid cursor name '<xxx-cursor-name-xxx>'
Test Failed.
*** End:   updatableResultSet jdk1.5.0_04 DerbyNetClient derbynetmats:derbynetmats 2006-06-20
12:17:00 ***

jdbcapi/URCoveringIndexTest.junit also failed:

********* Diff file derbyall/derbynetclientmats/DerbyNetClient/derbynetmats/jdbcapi/URCoveringIndexTest.diff
*** Start: URCoveringIndexTest jdk1.5.0_04 DerbyNetClient derbynetmats:jdbcapi 2006-06-20
12:28:52 ***
0 add
> .E..E.
> There were 2 errors:
> 1) testUpdateUpdatedTupleScrollPostitioned(org.apache.derbyTesting.functionTests.tests.jdbcapi.URCoveringIndexTest)java.sql.SQLException:
Invalid cursor name 'SQL_CURLH000C2'.
> Caused by: org.apache.derby.client.am.SqlException: Invalid cursor name 'SQL_CURLH000C2'.
> 	... 17 more
> 2) testUpdateUpdatedTupleFOPositioned(org.apache.derbyTesting.functionTests.tests.jdbcapi.URCoveringIndexTest)java.sql.SQLException:
Invalid cursor name 'SQL_CURLH000C3'.
> Caused by: org.apache.derby.client.am.SqlException: Invalid cursor name 'SQL_CURLH000C3'.
> 	... 17 more
> FAILURES!!!
> Tests run: 4,  Failures: 0,  Errors: 2
Test Failed.
*** End:   URCoveringIndexTest jdk1.5.0_04 DerbyNetClient derbynetmats:jdbcapi 2006-06-20
12:29:00 ***

Could you please take a look at those failures? Thanks!

> Client java.sql.ResultSet.getCursorName() does not return the correct cursor name for
Statements after the first execution
> --------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1183
>          URL: http://issues.apache.org/jira/browse/DERBY-1183
>      Project: Derby
>         Type: Bug

>   Components: JDBC
>     Versions: 10.2.0.0
>     Reporter: Kathey Marsden
>     Assignee: Dag H. Wanvik
>      Fix For: 10.2.0.0
>  Attachments: derby-1183.diff, derby-1183.stat
>
> For client, if the cursor name is set with java.sql.Statement.setCursorName() the name
set by the user only applies to the first execution.  Subsequent executions use the default
cursor name.  To reproduce run the progam below as follows:
> D>java -Dframework=DerbyNetClient GetCursorName
> 10.2.0.0 alpha
> Apache Derby
> Apache Derby Network Client JDBC Driver
> rs.getCursorName():MyCursor
> rs.getCursorName():SQL_CURLH000C2
> With embedded it is ok:
> D>java  GetCursorName
> 10.2.0.0 alpha
> Apache Derby
> Apache Derby Embedded JDBC Driver
> rs.getCursorName():MyCursor
> rs.getCursorName():MyCursor
> import java.sql.Connection;
> import java.sql.DatabaseMetaData;
> import java.sql.ResultSet;
> import java.sql.SQLException;
> import java.sql.Statement;
> import org.apache.derbyTesting.functionTests.util.TestUtil;
> class GetCursorName
> {
>     
>     public static void main (String args [])throws Exception 
>     {
>     	testGetCursorName();
>     }
>     
>     public static void testGetCursorName() throws SQLException
>     {
> 		
> 		Connection conn = TestUtil.getConnection("wombat","create=true");
> 		Statement stmt = null;
> 		ResultSet rs = null;
> 		DatabaseMetaData md = conn.getMetaData() ;
> 		System.out.println(md.getDatabaseProductVersion());
>         System.out.println(md.getDatabaseProductName());
>         System.out.println(md.getDriverName());
> 		
> 		stmt = conn.createStatement();
> 		// Setting the cursor name works for one execution ok.
> 		stmt.setCursorName("MyCursor");
> 		rs = stmt.executeQuery("select count(*) from sys.systables");
> 		System.out.println("rs.getCursorName():" + rs.getCursorName());
> 		rs.close();
> 		//Executing another query seems to clears the cursor name.
> 		// getCursorName() will print the default cursor name SQLXXX.
> 		rs = stmt.executeQuery("select count(*) from sys.systables");
> 		System.out.println("rs.getCursorName():" + rs.getCursorName());
> 		rs.close();
> 		stmt.close();
>         conn.close();
>       }
>   
> }
> I noticed this bug when coverting the checkDataSource test for client.
> I will change that test to set the cursor name for each execution for client.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message