db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "DatabaseManager" by DonaldMcLean
Date Thu, 19 Oct 2006 16:45:44 GMT
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).
  

Mime
View raw message