Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 91483 invoked from network); 17 May 2010 10:53:24 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 May 2010 10:53:24 -0000 Received: (qmail 1630 invoked by uid 500); 17 May 2010 10:53:24 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 1272 invoked by uid 500); 17 May 2010 10:53:21 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 1264 invoked by uid 99); 17 May 2010 10:53:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 May 2010 10:53:20 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mrkafk@gmail.com designates 209.85.161.46 as permitted sender) Received: from [209.85.161.46] (HELO mail-fx0-f46.google.com) (209.85.161.46) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 May 2010 10:53:12 +0000 Received: by fxm6 with SMTP id 6so3781302fxm.33 for ; Mon, 17 May 2010 03:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=3+8Sfo13Q+zg7xjt5kJGj2oXmSweMjaJrd8tHHFcqZw=; b=FWA3PltREvozPyI6ABq9AEEnAX1fGJkDPILVNVXnYtuJQkDow0YyhDkmxdLXLPNqA8 UkjY4gd9W2EDZkFfMvrLJOF2m9SW6YlyD8JrJkRxpqxkis50fBMQwYR43TzvMHHHpRPY PwvH3M0YmybwAzpSfM1X7WAiBVU2elOOIaIj4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=LiUwBFPKDiwyBGawF4jWCdsDsVJ8ty9527b5DG13BkkrkG7hlxee/DgXXBQkg8NXhY 8QRRie4Dniz5AKfRUPjYNSgSEG37LytyMNJ/G1o2fbI1Gemp6KzScMeegOpN+K+/VoAR qAZNgnyERS60XfXl4+2s4wfsJlSVLSVU8WupU= Received: by 10.223.62.202 with SMTP id y10mr6027458fah.100.1274093571115; Mon, 17 May 2010 03:52:51 -0700 (PDT) Received: from [9.167.27.42] (deibp9eh1--blueice3n1.emea.ibm.com [195.212.29.179]) by mx.google.com with ESMTPS id 7sm25297087far.6.2010.05.17.03.52.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 17 May 2010 03:52:50 -0700 (PDT) Message-ID: <4BF12001.6030805@gmail.com> Date: Mon, 17 May 2010 12:52:49 +0200 From: Marcin Krol User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: derby-user@db.apache.org Subject: ShutdownException while executing query Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello everyone, I'm new to Derby and don't know what I'm doing wrong: I have an app that produces a temporary file, loads it into Derby (with SYSCS_UTIL.SYSCS_IMPORT_TABLE), creates some indexes, and then executes a simple query: ResultSet res = derbyst.executeQuery("SELECT COUNT(*) FROM TMP_CVER"); printoutResultSet(res); printoutResultSet just iterates over result set rows. After printoutResultSet the program terminates. The thing is I'm frequently getting ShutdownExceptions when printoutResultSet is executing. It looks as if execution flew by printoutResultSet and finalized my class which caused .next() method on result set to throw an exception: I do get class finalization diagnostic printouts. But I'm not doing any multithreaded programming in this program. I'm puzzled as to what could cause this. private void printoutResultSet(ResultSet rs) throws SQLException { if (rs != null) { logger.trace("Result:"); ResultSetMetaData md = rs.getMetaData(); int colcount = md.getColumnCount(); while (rs.next()) { String line = ""; for (int i = 1; i <= colcount; i++) line += rs.getString(i) + ", "; System.out.println(line); } } else logger.trace("null ResultSet after executing h2 Query"); } -- Regards, mk -- Premature optimization is the root of all fun.