Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 33246 invoked from network); 4 Aug 2009 08:45:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Aug 2009 08:45:32 -0000 Received: (qmail 69503 invoked by uid 500); 4 Aug 2009 08:45:37 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 69437 invoked by uid 500); 4 Aug 2009 08:45:37 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 69429 invoked by uid 99); 4 Aug 2009 08:45:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 08:45:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 08:45:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CCB57234C045 for ; Tue, 4 Aug 2009 01:45:14 -0700 (PDT) Message-ID: <1657512845.1249375514824.JavaMail.jira@brutus> Date: Tue, 4 Aug 2009 01:45:14 -0700 (PDT) From: "Kristian Waagan (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Resolved: (DERBY-4333) Exception in getMaxRows() after NullPointerException in SQLClob.readExternal() during query in table with CLOB column In-Reply-To: <1421020868.1249325235120.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kristian Waagan resolved DERBY-4333. ------------------------------------ Resolution: Duplicate Fix Version/s: 10.6.0.0 10.5.2.0 This is a duplicate of DERBY-4245, merged to the 10.5 branch with revision 793565. For reference, I'm posting the stack trace with line numbers: java.lang.NullPointerException at org.apache.derby.iapi.types.SQLClob.readExternal(SQLClob.java:691) at org.apache.derby.impl.store.raw.data.StreamFileContainer.fetchNext(StreamFileContainer.java:860) at org.apache.derby.impl.store.raw.data.StreamFileContainerHandle.fetchNext(StreamFileContainerHandle.java:157) at org.apache.derby.impl.store.access.sort.MergeScan.mergeARow(MergeScan.java:231) at org.apache.derby.impl.store.access.sort.MergeScan.init(MergeScan.java:199) at org.apache.derby.impl.store.access.sort.MergeSort.openSortScan(MergeSort.java:263) at org.apache.derby.impl.store.access.RAMTransaction.openSortScan(RAMTransaction.java:1920) at org.apache.derby.impl.sql.execute.SortResultSet.loadSorter(SortResultSet.java:323) at org.apache.derby.impl.sql.execute.SortResultSet.openCore(SortResultSet.java:268) at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(BasicNoPutResultSetImpl.java:245) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:416) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:297) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1235) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1648) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(EmbedPreparedStatement.java:1303) at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source) at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source) I think the easiest way to confirm this, is for the reporter to try running with derby.jar from the 10.5.2 release candidate. NOTE: Due to the wrong result bug DERBY-4331, the release candidate should maybe not be used in production (at least you should investigate if the bug affects your application). > Exception in getMaxRows() after NullPointerException in SQLClob.readExternal() during query in table with CLOB column > ---------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-4333 > URL: https://issues.apache.org/jira/browse/DERBY-4333 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.5.1.1 > Reporter: Jason Ward > Assignee: Kristian Waagan > Fix For: 10.5.2.0, 10.6.0.0 > > Attachments: derby.log, derby_10.5_debug.zip > > > Observed derby 10.5.1.1 throwing exception in getMaxRows() when querying table with greater than ~20K rows and CLOB column. > The exception is : > java.sql.SQLException: No current connection. > at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source) > at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) > at org.apache.derby.client.am.Statement.getMaxRows(Unknown Source) > at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.getMaxRows(NewProxyPreparedStatement.java:1200) > at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:298) > at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:234) > at org.hibernate.loader.Loader.getResultSet(Loader.java:1826) > at org.hibernate.loader.Loader.doQuery(Loader.java:697) > at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) > at org.hibernate.loader.Loader.doList(Loader.java:2232) > at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129) > at org.hibernate.loader.Loader.list(Loader.java:2124) > at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118) > at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1597) > at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306) > at com.jw.TestMain.query(TestMain.java:175) > at com.jw.TestMain.main(TestMain.java:189) > Caused by: org.apache.derby.client.am.SqlException: No current connection. > at org.apache.derby.client.am.Statement.checkForClosedStatement(Unknown Source) > > In digging into the stacktrace a little more it seems that hibernates call to getMaxRows() blows up because checkForClosedStatement() throws the SQLException, but I have no idea why. (I've verified the connection is open prior to executing hibenates list(), and it happens too quickly to be a true timeout.) > > It only happens once my table reaches any significant size ( > 20K rows), and only on this particular table which includes a CLOB column. > Curiously 10.4.2.1 does not exhibit this behavior. > I have prepared a small eclipse project which repros the error and will attach. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.