[ https://issues.apache.org/jira/browse/DERBY-7098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17277262#comment-17277262 ]
Richard N. Hillegas commented on DERBY-7098: -------------------------------------------- Is it possible that the connection is shared, perhaps across threads, and that java.sql.Connection.commit() is being called unexpectedly? Try running the application with the following system properties... {noformat} -Dderby.language.logStatementText=true -Dderby.stream.error.logSeverityLevel=0 {noformat} ...and look for commits in derby.log. > Derby issues an ERROR java.sql.SQLException: ResultSet not open. Operation > 'next' not permitted. Verify that autocommit is off > -------------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-7098 > URL: https://issues.apache.org/jira/browse/DERBY-7098 > Project: Derby > Issue Type: Bug > Affects Versions: 10.14.2.0 > Environment: NetBeans IDE 12.0 > GLASSFISH > Java: 1.8.0_265; OpenJDK 64-Bit Server VM 25.265-b01 > Runtime: OpenJDK Runtime Environment 1.8.0_265-b01 > System: Windows 10 version 10.0 running on amd64; Cp1252; en_US (nb) > Reporter: Ed lang > Priority: Major > > While running queries derby issues: java.sql.SQLException: ResultSet not > open. Operation 'next' not permitted. Verify that autocommit is off > > This error appears to be unfounded. > The process it is in has run about 15 queries prior to this. Each Prepared > statement and result set is closed after use. > > Here are particulars: > *Manifest-Version: 1.0* > Ant-Version: Apache Ant 1.9.5 > Created-By: 1.8.0_151-b12 (Oracle Corporation) > Bundle-Vendor: Apache Software Foundation > Bundle-Name: Apache Derby 10.14 > Bundle-Version: 10.14.2000000.1828579 > Bundle-ManifestVersion: 2 > Sealed: true > Bundle-Activator: org.apache.derby.osgi.EmbeddedActivator > Bundle-SymbolicName: derby > DynamicImport-Package: * > Export-Package: org.apache.derby.authentication,org.apache.derby.datab > ase,org.apache.derby.io,org.apache.derby.jdbc,org.apache.derby.vti > Class-Path: derbyLocale_cs.jar derbyLocale_de_DE.jar derbyLocale_es.ja > r derbyLocale_fr.jar derbyLocale_hu.jar derbyLocale_it.jar derbyLocal > e_ja_JP.jar derbyLocale_ko_KR.jar derbyLocale_pl.jar derbyLocale_pt_B > R.jar derbyLocale_ru.jar derbyLocale_zh_CN.jar derbyLocale_zh_TW.jar > Name: org/apache/derby/impl/tools/sysinfo/ > Sealed: false > Name: org/apache/derby/iapi/services/context/ > Sealed: false > Name: org/apache/derby/iapi/services/info/ > Sealed: false > Name: org/apache/derby/jdbc/ > Sealed: false > Name: org/apache/derby/info/ > Sealed: false > Name: org/apache/derby/iapi/services/i18n/ > Sealed: false > Name: org/apache/derby/shared/common/error/ > Sealed: false > Name: org/apache/derby/shared/common/sanity/ > Sealed: false > Name: org/apache/derby/iapi/tools/i18n/ > Sealed: false > Name: org/apache/derby/loc/ > Sealed: false > Name: org/apache/derby/tools/ > Sealed: false > > *At Server Level:* > DP - database.Dictionary : USER : Derby Started at Address: > localhost/127.0.0.1 Port: 1527|#] > DP - database.Dictionary : USER PROPERTIES : > \{derby.drda.traceDirectory=E:\opt\avnoc\JAVADB, derby.drda.maxThreads=0, > derby.drda.sslMode=off, derby.drda.keepAlive=true, derby.drda.minThreads=0, > derby.drda.portNumber=1527, derby.drda.logConnections=false, > derby.drda.timeSlice=0, derby.drda.startNetworkServer=false, > derby.drda.host=localhost, derby.drda.traceAll=true}|#] > DP - database.Dictionary : USER runTimeInfo : --- Derby Network Server > Runtime Information --- > ---------- Session Information ------------------------- Session Information > ---------------Session # > :9-------------------------------------------------------------# Connection > Threads : 1# Active Sessions : 1# Waiting Sessions : 0Total Memory : > 257425408 Free Memory : 255180496|#] > > *At query level:* > autocommit: false warnings: null FreeMemory: 100835432|#] > > *The Code:* > > System.out.println("autocommit: " + this.conn.getAutoCommit() + " warnings: " > + this.conn.getWarnings() + " FreeMemory: " + > Runtime.getRuntime().freeMemory()); > > RUNTIME: autocommit: false warnings: null FreeMemory: 100835432|#] > > PreparedStatement psNHG2 = this.conn.prepareStatement("select * from ASSETS > where ID = ? and NAGNOTIFICATIONENABLED = '1' order by ASTSEQ"); > psNHG2.setString(1, this.custid); > ResultSet rsNHG2 = psNHG2.executeQuery(); > while (rsNHG2.next()) { > > I noticed in 2011 there was a similar issue but considered it to be > irrevelent as so many versions have transpired. -- This message was sent by Atlassian Jira (v8.3.4#803005)