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 "Bryan Pendleton (JIRA)" <de...@db.apache.org> on 2006/04/15 04:55:01 UTC

[jira] Resolved: (DERBY-585) ResultSet overflows when rows are inserted.

     [ http://issues.apache.org/jira/browse/DERBY-585?page=all ]
     
Bryan Pendleton resolved DERBY-585:
-----------------------------------

    Fix Version: 10.2.0.0
     Resolution: Duplicate

This problem reproduces cleanly against 10.1 after ~32000 iterations, but with the current trunk code I was able to run two million iterations, so it would seem that the bug is fixed. I'm not certain of this, but it seems quite possible that this bug was a duplicate of DERBY-210. 

I wasn't really sure what Resolution code to use for the bug report. I first chose "cannot reproduce", but that didn't seem quite right, because we *can* reproduce it in 10.1, just not in 10.2. I thought about marking it "fixed", but I don't have a specific Subversion revision to point to. So I chose "duplicate", since I am of the opinion that this bug is a duplicate of DERBY-210.


> ResultSet overflows when rows are inserted.
> -------------------------------------------
>
>          Key: DERBY-585
>          URL: http://issues.apache.org/jira/browse/DERBY-585
>      Project: Derby
>         Type: Bug

>   Components: JDBC, Network Client
>     Versions: 10.1.1.0
>  Environment: Red Hat Enterprise Linux ES release 3 (Taroon Update 4), intel
>     Reporter: Thierry de Pretto
>     Assignee: Bryan Pendleton
>      Fix For: 10.2.0.0

>
> Derby jdbc driver doesn't seem to be able to find the end of a
> ResultSet when rows are inserted while the ResultSet is walked. For
> instance, the execution of the code 
> import java.sql.Connection;
> import java.sql.Statement;
> import java.sql.PreparedStatement;
> import java.sql.SQLException;
> import java.sql.ResultSet;
> import java.sql.DriverManager;
> public class Test
> {
>     public static void main(String[] pArgs) throws Exception
>     {
>         Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
>         String url = "jdbc:derby://localhost:1527/sample";
> //         Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
> //         String url = "jdbc:derby:/tmp/sample;create=true";
>         Connection conn = DriverManager.getConnection(url);
>         Statement s = conn.createStatement();
>         try
>         {
>             s.execute("drop table q");
>         }
>         catch (Exception e)
>         {
>             System.out.println(e.toString());
>         }
>         try
>         {
>             s.execute("create table q(q integer)");
>         }
>         catch (Exception e)
>         {
>             System.out.println(e.toString());
>         }
>         PreparedStatement p = conn.prepareStatement("insert into q values (1)");
> //        for (int i = 0; i<=10; i++) { p.executeUpdate();} // it works for small table.
>         for (int i = 0; i<=10000; i++) { p.executeUpdate();} // it never ends for big table.
>         conn.commit();
>         ResultSet rs = s.executeQuery("SELECT q FROM q");
>         System.out.println("q, w");
>         while (rs.next()) {
>             int q = rs.getInt("q");
>             System.out.println(""+ q);
>             conn.createStatement().execute("insert into q values (2)");
>         }
>         rs.close();
>         s.close();
>     }
> }
> ends with exception
> Exception in thread "main" org.apache.derby.client.am.SqlException: Run out of sections to use,sections limited to 32k currently
> 	at org.apache.derby.client.am.SectionManager.getSection(Unknown Source)
> 	at org.apache.derby.client.am.SectionManager.getDynamicSection(Unknown Source)
> 	at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
> 	at org.apache.derby.client.am.Statement.executeX(Unknown Source)
> 	at org.apache.derby.client.am.Statement.execute(Unknown Source)
> 	at Test.main(Test.java:95)
> if table q is big enough because ResultSet.next() seems to retrieve
> the rows inserted after the select execution. Note that it also occurs
> for join statement.

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