Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 35134 invoked from network); 19 Oct 2006 16:46:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Oct 2006 16:46:23 -0000 Received: (qmail 25016 invoked by uid 500); 19 Oct 2006 16:46:06 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 24994 invoked by uid 500); 19 Oct 2006 16:46:06 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 24971 invoked by uid 99); 19 Oct 2006 16:46:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Oct 2006 09:46:06 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Oct 2006 09:46:06 -0700 Received: from ajax.apache.org (localhost [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id DE5C1D495D for ; Thu, 19 Oct 2006 17:45:44 +0100 (BST) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: derby-commits@db.apache.org Date: Thu, 19 Oct 2006 16:45:44 -0000 Message-ID: <20061019164544.15393.36281@ajax.apache.org> Subject: [Db-derby Wiki] Update of "DatabaseManager" by DonaldMcLean X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dear Wiki user, You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification. The following page has been changed by DonaldMcLean: http://wiki.apache.org/db-derby/DatabaseManager ------------------------------------------------------------------------------ Derby and Hibernate are each very large packages full of power and fraught with complexities. When I first started working with them, I desperately wanted a very simple mechanism that would handle the basic drudgery so that I could concentrate on writing my application. The led me to the creation of a fairly small class (~300 lines) that did everything that I needed. Please see the DatabaseManagerSource and the DatabaseUtilitiesSource. + + I have learned that there is one troublesome issue with this implementation. Each class defined to be handled by Hibernate requires several seconds worth of initialization and in some instance, this can be fatal. I was trying to use it in a web application. At first, I had the DatabaseManager being created by the first page access - and that made the first page access very slow. Next I tried adding an initialization call to the "init" method of one of the servlets. That caused the "enable" to time out. Eventually what I found that worked was putting the initialization in a seperate thread. The initialization was started by the "init" method of one of the servlets and by the time I was ready to get the first page, things were usually good to go - but regardless, there weren't any ugly or fatal timeouts. + + When I have the web app in question up, running and reasonably stable, I will probably put that version of the DatabaseManager up. + === Configuration Files === The glue that makes everything work is the configuration files. A Hibernate file for each class (MyClass.hbm.xml) and a DatabaseManager.xml file (in the same package as the DatabaseManager class).