Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 48073 invoked from network); 22 Jun 2009 15:27:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jun 2009 15:27:19 -0000 Received: (qmail 24601 invoked by uid 500); 22 Jun 2009 15:27:29 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 24553 invoked by uid 500); 22 Jun 2009 15:27:29 -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 24545 invoked by uid 99); 22 Jun 2009 15:27:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 15:27:29 +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; Mon, 22 Jun 2009 15:27:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 97DEF234C1E6 for ; Mon, 22 Jun 2009 08:27:07 -0700 (PDT) Message-ID: <1631031439.1245684427620.JavaMail.jira@brutus> Date: Mon, 22 Jun 2009 08:27:07 -0700 (PDT) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-2074) Several times exception from derby implementation was thrown (were unable to eproduce and check if it caused by any our work) In-Reply-To: <31565159.1163415397082.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-2074?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-2074: -------------------------------------- Attachment: d2074-1a.diff Here's an alternative fix (d2047-1a.diff). I'm not able to reproduce the bug when it's applied, and replication also works with this change. Will run the full regression test suite to see if it introduces any other problems, and I'll also see if I can add a JUnit test case. In this patch, I've added a flag to ModuleInstance to indicate whether or not the instance has finished booting. TopService.bootModule() checks this flag when it walks through the moduleInstances list looking for an already booted instance to use, and skips the module instance if it isn't fully booted. This fixes the bug since the code that failed because the module was only partly initialized, will no longer be called unless it's fully initialized. In the cases where we'd get a NullPointerException before, we'll now create and boot two separate instances of the module. But there's already a window in which it is possible to end up booting two instances of the same module (because we drop the synchronization while booting) and it is correctly handled by the existing code, so widening the window shouldn't cause any problems. TopService.bootModule() handles it by checking if someone else successfully added an instance while we were initializing ours. If so, our instance will be discarded and we'll fall back to the other newly created instance. > Several times exception from derby implementation was thrown (were unable to eproduce and check if it caused by any our work) > ----------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-2074 > URL: https://issues.apache.org/jira/browse/DERBY-2074 > Project: Derby > Issue Type: Bug > Components: Store > Affects Versions: 10.1.3.1 > Environment: WinXP Professional, Java 1.5.0_06 > Reporter: Kovylin Alexandr > Assignee: Knut Anders Hatlen > Priority: Minor > Attachments: d2074-1a.diff, LoadSorter.java > > > 12:34:45,323 ERROR [pool-1-thread-3] history.helpers.HistoryDataAccessHelper - failed to read measurements, filter = (fromTime=Mon Nov 06 12:34:00 MSK 2006, toTime=Mon Nov 13 12:34:00 MSK 2006, , properties=2-6-2-value) org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT COUNT(DISTINCT sshis.measurement_time) FROM sshis_property_measurement sshis INNER JOIN sstmp_filter_3 filtertbl ON sshis.property_id = filtertbl.property_id WHERE sshis.measurement_time >= ? AND sshis.measurement_time < ?]; SQL state [XJ001]; error code [0]; Java exception:': > java.lang.NullPointerException'.; nested exception is > org.apache.derby.impl.jdbc.EmbedSQLException: Java exception: ': java.lang.NullPointerException'. > java.lang.NullPointerException > at java.util.Hashtable.put(Unknown Source) > at org.apache.derby.impl.store.access.RAMAccessManager.registerAccessMethod(Unknown Source) > at org.apache.derby.impl.store.access.RAMAccessManager.findMethodFactoryByImpl(Unknown Source) > at org.apache.derby.impl.store.access.RAMTransaction.createSort(UnknownSource) > at org.apache.derby.impl.sql.execute.DistinctScalarAggregateResultSet.loadSorter(Unknown Source) > at org.apache.derby.impl.sql.execute.DistinctScalarAggregateResultSet.openCore(Unknown Source) > at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(Unknown Source) > at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source) > at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source) > at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:535) > at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:476) > at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:528) > at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:561) > at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:579) > at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:589) > at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:619) > at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:629) > at org.springframework.jdbc.core.JdbcTemplate.queryForInt(JdbcTemplate.java:656) > at com.meshnetics.wsn.ctrl.dispatcher.services.history.helpers.MeasurementsSaveGetHelper.getMeasurements(MeasurementsSaveGetHelper.java:81) > at com.meshnetics.wsn.ctrl.dispatcher.services.history.helpers.HistoryDataAccessHelper$7.doInTransaction(HistoryDataAccessHelper.java:315) > at com.meshnetics.wsn.ctrl.dispatcher.services.history.helpers.HistoryDataAccessHelper$7.doInTransaction(HistoryDataAccessHelper.java:314) > at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:117) > at com.meshnetics.wsn.ctrl.dispatcher.services.history.helpers.HistoryDataAccessHelper.getMeasurements(HistoryDataAccessHelper.java:313) > at com.meshnetics.wsn.ctrl.dispatcher.services.history.asyncread.MeasurementsReadTask.executeTask(MeasurementsReadTask.java:127) > at com.meshnetics.wsn.ctrl.dispatcher.services.history.asyncread.MeasurementsReadTask.run(MeasurementsReadTask.java:97) > at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) > at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) > at java.util.concurrent.FutureTask.run(Unknown Source) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) > at java.lang.Thread.run(Unknown Source) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.