Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 10018 invoked from network); 17 Apr 2008 19:22:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Apr 2008 19:22:14 -0000 Received: (qmail 59215 invoked by uid 500); 17 Apr 2008 19:22:14 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 59194 invoked by uid 500); 17 Apr 2008 19:22:13 -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 59183 invoked by uid 99); 17 Apr 2008 19:22:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2008 12:22:13 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [81.201.48.35] (HELO smtp.klfree.net) (81.201.48.35) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2008 19:21:22 +0000 Received: from [192.168.123.2] (belgarat.klfree.czf [10.102.31.133]) by smtp.klfree.net (Postfix) with ESMTP id B672C524D3C for ; Thu, 17 Apr 2008 21:21:35 +0200 (CEST) Message-ID: <4807A344.2050509@volny.cz> Date: Thu, 17 Apr 2008 21:21:40 +0200 From: Svata Dedic User-Agent: Mozilla-Thunderbird 2.0.0.9 (X11/20080109) MIME-Version: 1.0 To: Derby Discussion Subject: Re: Deadlock when getting DB metadata References: <48065E5C.9010206@volny.cz> <48072574.9020009@volny.cz> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Knut Anders Hatlen wrote: > There is one workaround you may try out: Right after you have created > the database you can invoke DatabaseMetaData.getColumns() and any other > meta-data calls you expect to use. Then the internal meta-data queries > will be compiled and their execution plans stored in the database, so > that you don't need to compile them at the point where you now see the > deadlock. It is the (internal) compilation of the meta-data queries that > causes the deadlock. > The application attempts to read the DB schema right after it connects to the database. Then, after DB schema change operation, it re-reads some tables/indexes/foreign keys to keep the 'mental image' up-to-date, using the same code (although limited to scan just some table(s) metadata). In this situation, the DB already contained some tables when the app started, so statements to discover exported/imported FKs, indexes, column and table definitions were already processed and compiled at the start, long before the operation that caused the deadlock was executed. Is there a logger I can enable to see exact statements being compiled internally ? I would like to verify the above, or at least discover which type of commands are executed. Thanks, -Svata