Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 35757 invoked from network); 7 May 2007 13:41:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 May 2007 13:41:19 -0000 Received: (qmail 98773 invoked by uid 500); 7 May 2007 13:41:24 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 98736 invoked by uid 500); 7 May 2007 13:41:24 -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 98725 invoked by uid 99); 7 May 2007 13:41:24 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2007 06:41:23 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of danielrv.list@gmail.com designates 64.233.184.232 as permitted sender) Received: from [64.233.184.232] (HELO wr-out-0506.google.com) (64.233.184.232) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2007 06:41:16 -0700 Received: by wr-out-0506.google.com with SMTP id 25so1467279wry for ; Mon, 07 May 2007 06:40:56 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=k6Dp6Qhk+QNH6xyNCuodMENIEckD5a947hfeUDgvn35xhtsAuGBY1+AL1Ah5IFT+lg/HMQMXQ044MHL4/3Cf3UFXlWfDO/Oja0nCOGDExDT4U9aS+T9ievTnwB/tv7NK0yVx2B6n8Fc3RTXDhGbZ5NX5Uwyz4JifAr43OUCYe78= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=TxC3ppB8AuFKUuiFtl4HMQdmCmSQcgHvEmTVUASpUIzaC7zjgY1wrq7EnnxDnyKik/lUfh7y/ve4aXPwG9ZrK+EBnAPaGMvP7sX1MiLxkzmdULFr/0fo5ic10nSA/tpWZH5v2Cpa4/eZZ6xytJwz/pT8xxSvb6bEKy0RF7cGAhg= Received: by 10.78.160.4 with SMTP id i4mr2200273hue.1178545255096; Mon, 07 May 2007 06:40:55 -0700 (PDT) Received: by 10.78.181.16 with HTTP; Mon, 7 May 2007 06:40:55 -0700 (PDT) Message-ID: <3e2bde3a0705070640t373c1b4em8abbfae9d84b4d0c@mail.gmail.com> Date: Mon, 7 May 2007 15:40:55 +0200 From: "Daniel Ramos Vazquez" To: derby-user@db.apache.org Subject: Problem with concurrent queries and transactions. MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hi! I'm using derby 10.2.2.0 in a standalone Java application. I perform some queries in concurrent threads over derby DB, in a transactional environment, using JOTM. In conditions of high load of queries, I get some of these SQL Exceptions: - SQL Exception: ResultSet not open. Operation 'next' not permitted. Verify that autocommit is OFF. - SQL Exception: 'Statement' already closed. when I try to obtain the result of some "SELECT" queries. The code is like this: .... PreparedStatement ps = null; ResultSet rs = null; try { ps = connection.prepareStatement("SELECT xml_data FROM tablename WHERE name = ?"); int i = 1; ps.setString(i++, name); rs = ps.executeQuery(); if (rs.next()) { InputStream inputStream = rs.getBinaryStream(1); resultObject = object_storage.load(inputStream); } else { throw new StorageInternalException("Object not found."); } return resultObject; } catch (SQLException e) { ... } I get the errors executing the "next()" method on the ResultSet. If there is no transaction when I execute the query, the error never happens. Which could be the problem? Thanks.