Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5FA2FDEA6 for ; Fri, 21 Dec 2012 16:38:44 +0000 (UTC) Received: (qmail 3813 invoked by uid 500); 21 Dec 2012 16:38:44 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 3777 invoked by uid 500); 21 Dec 2012 16:38:44 -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 3770 invoked by uid 99); 21 Dec 2012 16:38:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Dec 2012 16:38:44 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kristian.waagan@oracle.com designates 141.146.126.69 as permitted sender) Received: from [141.146.126.69] (HELO aserp1040.oracle.com) (141.146.126.69) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Dec 2012 16:38:36 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBLGcEVl005334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 21 Dec 2012 16:38:15 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBLGcDAG012113 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 21 Dec 2012 16:38:14 GMT Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBLGcDsQ017616 for ; Fri, 21 Dec 2012 10:38:13 -0600 Received: from [192.168.2.103] (/93.193.106.120) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 21 Dec 2012 08:38:13 -0800 Message-ID: <50D49071.5000104@oracle.com> Date: Fri, 21 Dec 2012 17:38:09 +0100 From: Kristian Waagan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: derby-user@db.apache.org Subject: Re: what do errors like these mean? References: <619F13B2042F204E8E8E93D73870255809E0842A@EXJSQUSDAG04.ad.jefco.com> <87r4mj7bhs.fsf@oracle.com> <619F13B2042F204E8E8E93D73870255809E08910@EXJSQUSDAG04.ad.jefco.com> In-Reply-To: <619F13B2042F204E8E8E93D73870255809E08910@EXJSQUSDAG04.ad.jefco.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-Virus-Checked: Checked by ClamAV on apache.org On 21.12.2012 16:18, Pavel Bortnovskiy wrote: > Thank you, Knut, for your prompt response. > > It seems that my caching of Prepared Statements is causing some problems. > In some previous responses, it was indicated that Derby is caching them internally anyway, so maybe a better approach for me is not to cache them on my side and create them anew? Most of my inserts/updates are done in batches, so I could create a PrepStmt before the batch and remove a reference to it at the end of the batch's execution. If the performance penalty for compilation of PrepStmt is not that great, then such approach may be more desirable to avoid errors in the production environment. Hi Pavel, Are you using the embedded driver or the client driver? The client driver can cache statements on the client side if you use the ConnectionPoolDataSource. This may save you some round-trips, but note that this caching is in addition to the caching that happens on the server side. -- Kristian > > Thanks, > P. > > -----Original Message----- > From: Knut Anders Hatlen [mailto:knut.hatlen@oracle.com] > Sent: Friday, December 21, 2012 8:59 AM > To: Derby Discussion > Subject: Re: what do errors like these mean? > > Pavel Bortnovskiy writes: > >> Once in a while, I see the following errors. What may cause them? >> >> java.sql.SQLException: Container 1,329 not found. > The error means that one of the database files (table or index) cannot be found. It typically happens because some DDL operation (for example DROP INDEX, TRUNCATE TABLE or SYSCS_COMPRESS_TABLE) has removed the file, and an already compiled statement still references it. > > The error indicates a bug in Derby, so if you find a way to reproduce it, or some pattern that seems to increase the likelihood of the error, please file a bug report. > > Derby should invalidate already compiled statement referencing the table when DDL is performed on it, and that should make the statement recompile automatically the next time it is executed. There have been bugs in that area, though. (We fixed some of them in 10.9.1.0, in case you haven't already upgraded.) > > One possible workaround in that case is to call the SYSCS_UTIL.SYSCS_EMPTY_STATEMENT_CACHE procedure to remove the stale query plans from the statement cache. > > -- > Knut Anders > > Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee of this email you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. This email may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the Financial Services Authority.