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 "Paul taylor (Created) (JIRA)" <ji...@apache.org> on 2011/12/16 13:30:30 UTC

[jira] [Created] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
--------------------------------------------------------------------------------------------------------------------------------------------

                 Key: DERBY-5545
                 URL: https://issues.apache.org/jira/browse/DERBY-5545
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.8.2.2
         Environment: OSX 10.6
            Reporter: Paul taylor


Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
  
Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173615#comment-13173615 ] 

Dag H. Wanvik commented on DERBY-5545:
--------------------------------------

Any chance pooled.getConnection could return the same connection to two threads? If so, one might commit and close the result set for the other thread..
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13453131#comment-13453131 ] 

Dag H. Wanvik commented on DERBY-5545:
--------------------------------------

No problem, John, I was too quick on the trigger :) Thanks again for alerting us to this behavior.
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "John Hendrikx (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452909#comment-13452909 ] 

John Hendrikx commented on DERBY-5545:
--------------------------------------

I read the mailing list reply, and I disagree.

rollback != releaseSavepoint

rollback -> rolls back to entire transaction
releaseSavepoint -> rolls back only the statements since the savepoint was created -- any statements before that are unaffected

Rolling back a savepoint should have no influence on the transaction itself, as otherwise there is no point in using them -- after all, they are there so you can rollback *part* of your sequence of SQL statements so you can *continue* with further SQL statements.  This code also functions correctly when I replace the database with PostgreSQL -- it does not close the outer ResultSet after rolling back a save point.
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13453092#comment-13453092 ] 

Dag H. Wanvik edited comment on DERBY-5545 at 9/12/12 2:25 AM:
---------------------------------------------------------------

I find Derby closes open result sets for all rollback actions. I do not think is wrong as per the SQL semantics, although it may be unexpected: The savepoint sets a limit to how much of *updates* will be rolled back: Any updates performed within the main transaction *before* the save point will be kept even after the rollback(sp).
I guess Derby could keep track of result sets that were opened *before* the savepoint was set and only close those opened *after*, but that's not the current behavior as you have observed.

The JDBC specification has been unclear on when to close result sets in the past, although its clearer in the current version (4.1). I'll have a check there and also look at the defined semantics for SQL cursors (which corresponds to JDBC result sets more or less) and see how those are defined in the presence of savepoints.

Update: In section 16.7 <rollback statement>, section General Rule 3) <savepoint specified>, clause g) reads: 

"For every open cursor CR in any SQL-client module associated with the current SQL-transaction that
was opened subsequent to the establishment of S, the following statement is implicitly executed:
CLOSE CR"

I take that to mean that the cursor should remain open iff it was established prior to the savepoint, and, by analogy, the JDBC result set shoudl stay open too.

Now clause h) states:

"The status of any open cursors in any SQL-client module associated with the current SQL-transaction
that were opened by the current SQL-transaction before the establishment of S is implementation defined.


So, the behavior is "implementation defined", which means Derby's implementation is OK with the standard. I agree this could be improved to stay open though. I'll file this as an improvement request.
                
      was (Author: dagw):
    I find Derby closes open result sets for all rollback actions. I do not think is wrong as per the SQL semantics, although it may be unexpected: The savepoint sets a limit to how much of *updates* will be rolled back: Any updates performed within the main transaction *before* the save point will be kept even after the rollback(sp).
I guess Derby could keep track of result sets that were opened *before* the savepoint was set and only close those opened *after*, but that's not the current behavior as you have observed.

The JDBC specification has been unclear on when to close result sets in the past, although its clearer in the current version (4.1). I'll have a check there and also look at the defined semantics for SQL cursors (which corresponds to JDBC result sets more or less) and see how those are defined in the presence of savepoints.

Update: In section 16.7 <rollback statement>, section General Rule 3) <savepoint specified>, clause g) reads: 

"For every open cursor CR in any SQL-client module associated with the current SQL-transaction that
was opened subsequent to the establishment of S, the following statement is implicitly executed:
CLOSE CR"

I take that to mean that the cursor should remain open iff it was established prior to the savepoint, and, by analogy, the JDBC result set shoudl stay open too.

Conclusion: this is a bug. Thanks for spotting this, John!
                  
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452969#comment-13452969 ] 

Dag H. Wanvik commented on DERBY-5545:
--------------------------------------

John, thanks, I now see you used rollback(sp), not plain rollback(). I'll have a look to see why rollback(sp) closes the first result set.
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "John Hendrikx (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452912#comment-13452912 ] 

John Hendrikx commented on DERBY-5545:
--------------------------------------

Note that the there are two rollbacks:

connection.rollback() --> rolls back entire transaction (I'm not using that one)

and:

connection.rollback(savePoint) --> rolls back everything since the matching call to connection.setSavePoint()

It shouldn't close the outer result set when using the latter method.
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Paul taylor (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13171838#comment-13171838 ] 

Paul taylor commented on DERBY-5545:
------------------------------------

The error is not actually occurring for me but for a customer I dont seem to have a derby.log I'll look into configuring that. I can confirm the next() does occur after the query on the very next line, no other threads could be consuming the resultset. I am using database pooling so if there was problem with that I suppose it would be feasible that another thread could close the connection that this thread had opened but that could only happen if there was a bug in the pooling or database as my code gets the pooled connection directly before making the query and it is private to this method.

I dont see how I can make a reproducible testcase as the problem does not hgappen consistently the code runs perfectly for some time before the error occurs, whihc does lead me to suspect it is linked to a reosurce problem, I think the first step is to configure a derby.log
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "John Hendrikx (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452909#comment-13452909 ] 

John Hendrikx edited comment on DERBY-5545 at 9/11/12 10:05 PM:
----------------------------------------------------------------

I read the mailing list reply, and I disagree.

rollback() != rollback(Savepoint)

rollback -> rolls back to entire transaction
rollback(Savepoint) -> rolls back only the statements since the savepoint was created -- any statements before that are unaffected

Rolling back a savepoint should have no influence on the transaction itself, as otherwise there is no point in using them -- after all, they are there so you can rollback *part* of your sequence of SQL statements so you can *continue* with further SQL statements.  This code also functions correctly when I replace the database with PostgreSQL -- it does not close the outer ResultSet after rolling back a save point.

EDIT: Corrected confusing terminology
                
      was (Author: john16384):
    I read the mailing list reply, and I disagree.

rollback != releaseSavepoint

rollback -> rolls back to entire transaction
releaseSavepoint -> rolls back only the statements since the savepoint was created -- any statements before that are unaffected

Rolling back a savepoint should have no influence on the transaction itself, as otherwise there is no point in using them -- after all, they are there so you can rollback *part* of your sequence of SQL statements so you can *continue* with further SQL statements.  This code also functions correctly when I replace the database with PostgreSQL -- it does not close the outer ResultSet after rolling back a save point.
                  
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Paul taylor (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173091#comment-13173091 ] 

Paul taylor commented on DERBY-5545:
------------------------------------

I found the derby log but it had nothing useful in it, do I have to enable a debugging mode or should any problems be logged anyway ?
I dont think there was any interrupt, there is nothing to indicate that an interrupt occurred
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "John Hendrikx (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13453124#comment-13453124 ] 

John Hendrikx commented on DERBY-5545:
--------------------------------------

Sorry that I wasn't more clear, I should have posted a piece code right away.

Anyway, I understand, so the behaviour is allowed according to the specification, although somewhat unexpected for the user.  And I agree the original issue might have been something else, it looked related at first glance.
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172319#comment-13172319 ] 

Dag H. Wanvik commented on DERBY-5545:
--------------------------------------

Long shot:  could there be interrupts occurring of the Derby threads here? I seem to remember we have had issues with 3cpo and interrupts before. Derby 10.8.2.2 is supposed to survive interrupt better (it should either throw a session level exception - the connection is lost and you'd need to reconnect - or continue operating normally), but it may be worth investigating.
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Paul taylor (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173429#comment-13173429 ] 

Paul taylor commented on DERBY-5545:
------------------------------------

This is where the code goes wrong
..
            rs = Db.getInstance().runQuery("select * from song where fullfilename='" + Db.escapeChars(fullfilename) + '\'');
            if (rs.next())
...

Db.getInstance() returns a singleton of db class (it is already initilized)

runQuery method is:

public ResultSet runQuery(String resultsQuery) throws SQLException
    {
        MainWindow.logger.finest("Executing query:"+resultsQuery);
        try
        {
            Connection c = createConnection();
            Statement s = c.createStatement();
            ResultSet rs = s.executeQuery(resultsQuery);
            return rs;
        }
        catch (SQLException sqle)
        {
            printSQLException(sqle, resultsQuery);
            throw sqle;
        }
    }

createConnection method is:

public Connection createConnection() throws SQLException
    {
        try
        {
            Connection c=pooled.getConnection();
            c.setAutoCommit(false);
            return c;
        }
        catch(SQLException e)
        {
            printSQLException(e, null);
            throw e;
        }
    }

So you can see the connection isnt shared, but multiple threads do share the Db instance, Im wondering if there is a thread safety issue in that class somehow, and there could be two threads running the same method. 
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13453092#comment-13453092 ] 

Dag H. Wanvik edited comment on DERBY-5545 at 9/12/12 2:31 AM:
---------------------------------------------------------------

I find Derby closes open result sets for all rollback actions. I do not think is wrong as per the SQL semantics, although it may be unexpected: The savepoint sets a limit to how much of *updates* will be rolled back: Any updates performed within the main transaction *before* the save point will be kept even after the rollback(sp).
I guess Derby could keep track of result sets that were opened *before* the savepoint was set and only close those opened *after*, but that's not the current behavior as you have observed.

The JDBC specification has been unclear on when to close result sets in the past, although its clearer in the current version (4.1). I'll have a check there and also look at the defined semantics for SQL cursors (which corresponds to JDBC result sets more or less) and see how those are defined in the presence of savepoints.

Update: In SQL 2003, vol2, section 16.7 <rollback statement>, section General Rule 3) <savepoint specified>, clause g) reads: 

"For every open cursor CR in any SQL-client module associated with the current SQL-transaction that
was opened subsequent to the establishment of S, the following statement is implicitly executed:
CLOSE CR"

I take that to mean that the cursor should remain open iff it was established prior to the savepoint, and, by analogy, the JDBC result set shoudl stay open too.

Now clause h) states:

"The status of any open cursors in any SQL-client module associated with the current SQL-transaction
that were opened by the current SQL-transaction before the establishment of S is implementation defined.


So, the behavior is "implementation defined", which means Derby's implementation is OK with the standard. I agree this could be improved to stay open though. I'll file this as an improvement request.
                
      was (Author: dagw):
    I find Derby closes open result sets for all rollback actions. I do not think is wrong as per the SQL semantics, although it may be unexpected: The savepoint sets a limit to how much of *updates* will be rolled back: Any updates performed within the main transaction *before* the save point will be kept even after the rollback(sp).
I guess Derby could keep track of result sets that were opened *before* the savepoint was set and only close those opened *after*, but that's not the current behavior as you have observed.

The JDBC specification has been unclear on when to close result sets in the past, although its clearer in the current version (4.1). I'll have a check there and also look at the defined semantics for SQL cursors (which corresponds to JDBC result sets more or less) and see how those are defined in the presence of savepoints.

Update: In section 16.7 <rollback statement>, section General Rule 3) <savepoint specified>, clause g) reads: 

"For every open cursor CR in any SQL-client module associated with the current SQL-transaction that
was opened subsequent to the establishment of S, the following statement is implicitly executed:
CLOSE CR"

I take that to mean that the cursor should remain open iff it was established prior to the savepoint, and, by analogy, the JDBC result set shoudl stay open too.

Now clause h) states:

"The status of any open cursors in any SQL-client module associated with the current SQL-transaction
that were opened by the current SQL-transaction before the establishment of S is implementation defined.


So, the behavior is "implementation defined", which means Derby's implementation is OK with the standard. I agree this could be improved to stay open though. I'll file this as an improvement request.
                  
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13453092#comment-13453092 ] 

Dag H. Wanvik commented on DERBY-5545:
--------------------------------------

I find Derby closes open result sets for all rollback actions. I do not think is wrong as per the SQL semantics, although it may be unexpected: The savepoint sets a limit to how much of *updates* will be rolled back: Any updates performed within the main transaction *before* the save point will be kept even after the rollback(sp).
I guess Derby could keep track of result sets that were opened *before* the savepoint was set and only close those opened *after*, but that's not the current behavior as you have observed.

The JDBC specification has been unclear on when to close result sets in the past, although its clearer in the current version (4.1). I'll have a check there and also look at the defined semantics for SQL cursors (which corresponds to JDBC result sets more or less) and see how those are defined in the presence of savepoints.

Update: In section 16.7 <rollback statement>, section General Rule 3) <savepoint specified>, clause g) reads: 

"For every open cursor CR in any SQL-client module associated with the current SQL-transaction that
was opened subsequent to the establishment of S, the following statement is implicitly executed:
CLOSE CR"

I take that to mean that the cursor should remain open iff it was established prior to the savepoint, and, by analogy, the JDBC result set shoudl stay open too.

Conclusion: this is a bug. Thanks for spotting this, John!
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173362#comment-13173362 ] 

Dag H. Wanvik commented on DERBY-5545:
--------------------------------------

If a query is successful, the result set should be open and the call to next should return true or false, depending on whether there query generated any data. You stack trace indicated the result set is not open. I don't see how this could happen. Possibilities:

a) somehow, the result set gets closed. This could be due to some code between the successful query and the call to next in the current thread, or some other thread got hold of the result set. You state this is not the case.
b) some unknown bug in Derby makes it return a result set in the closed state without throwing an SQLException.

Without more data, I cannot say what the issue is. Can you show the code fragment of the query and the "next" call? 

                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13453106#comment-13453106 ] 

Dag H. Wanvik commented on DERBY-5545:
--------------------------------------

I logged DERBY-5921 for an improvement request for John's case. In  any case, I think the original error of this issue did not mention using a savepoint so it's probably(?) another issue.
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Re: [jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by Dag Wanvik <da...@oracle.com>.
> Sequence of events
>
> Connection created
> query executed, resultSet obtained (1 record)
> rs.next()
> --savepoint set
> --query executed, resulSet obtained (1 record)
> --savepoint rollback
> rs.next() ->  exception (I would expect false to be returned).
>
> Now, I can reproduce this every single time.  If I change the savepoint rollback to a releaseSavepoint then it works.  This must be a bug I think?

In this case, the rollback aborts the transaction, so the first result 
set is closed when the final next is attempted.
  Cf code:

     public static void main(String[] args) throws SQLException {
         PreparedStatement ps;
         Connection c = 
DriverManager.getConnection("jdbc:derby:wombat;create=true");
         if (c.getWarnings() == null) {
             ps = c.prepareStatement("create table t(i int)");
             ps.executeUpdate();

             ps =c.prepareStatement("insert into t values 1,2,3,4,5,6");
         }

         ps = c.prepareStatement("select * from t where i=1");
         c.setAutoCommit(false);
         ResultSet rs = ps.executeQuery();
         rs.next();
         Savepoint sp = c.setSavepoint();
         ResultSet rs2 = c.createStatement().executeQuery("select * from 
t where i=3");
         // c.rollback();    // closes transaction, releaseSavepoint 
does not
         c.releaseSavepoint(sp);
         rs.next();             // throws iff we use rollback above

so I believe this behavior is correct. The exception seen w/rollback 
states this clearly:

"Exception in thread "main" java.sql.SQLException: ResultSet not open. 
Operation 'next' not permitted. Verify that autocommit is off."

Of course, the bit about auto-commit is misleading here.

Thanks,
Dag




>
>> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.
>> --------------------------------------------------------------------------------------------------------------------------------------------
>>
>>                  Key: DERBY-5545
>>                  URL: https://issues.apache.org/jira/browse/DERBY-5545
>>              Project: Derby
>>           Issue Type: Bug
>>           Components: JDBC
>>     Affects Versions: 10.8.2.2
>>          Environment: OSX 10.6
>>             Reporter: Paul taylor
>>               Labels: derby_triage10_9
>>
>> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>>
>> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
>> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
>> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
>> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
>> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
>> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
>> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
>> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
>> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
>> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators
> For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "John Hendrikx (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451360#comment-13451360 ] 

John Hendrikx commented on DERBY-5545:
--------------------------------------

I've got this too, and I tracked it down to a query within a savepoint.

I'm using the embedded driver, and basically the sequence of events that is causing this is:


Sequence of events

Connection created
query executed, resultSet obtained (1 record)
rs.next()
--savepoint set
--query executed, resulSet obtained (1 record)
--savepoint rollback
rs.next() -> exception (I would expect false to be returned).

Now, I can reproduce this every single time.  If I change the savepoint rollback to a releaseSavepoint then it works.  This must be a bug I think?
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13171198#comment-13171198 ] 

Dag H. Wanvik commented on DERBY-5545:
--------------------------------------

Do you see anything indicating a memory problem, say, in derby.log? If you are certain the next() happens immediately after a successful query, could there be other threads consuming/closing the result set? If you could make a repro it would be helpful.

                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452842#comment-13452842 ] 

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

Link to Dag's response on derby-dev for those who are not on the mailing list: http://mail-archives.apache.org/mod_mbox/db-derby-dev/201209.mbox/%3C504E09A3.4080401%40oracle.com%3E
                
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (DERBY-5545) Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run.

Posted by "Mamta A. Satoor (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor updated DERBY-5545:
-----------------------------------

    Component/s:     (was: SQL)
                 JDBC
        Urgency: Normal
         Labels: derby_triage10_9  (was: )
    
> Exception ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF exception occuring on rs.next() after long run. 
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5545
>                 URL: https://issues.apache.org/jira/browse/DERBY-5545
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>         Environment: OSX 10.6
>            Reporter: Paul taylor
>              Labels: derby_triage10_9
>
> Im seeing this error occur after loading alot of data into the Database. I can confirm that autocommit is set to off, and that it occurs on calling  rs.next() immediatlely after running a query and assigning to  resultset rs. The cdoe is called many times (250,000) and usually works, then suddenly it starts going wrong, I also using c3po database pooling. Im wondering if the problem is linked to memory consumption although I have no OutOfMemoryError occurring
>   
> Java.sql.SQLException: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.checkExecIfClosed(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
> 	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira