geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Boynes <jboy...@apache.org>
Subject Re: CMP tables - can they be created automatically?
Date Tue, 05 Jul 2005 18:48:20 GMT
Sing Li wrote:
> I have the same problem with a CMP example - how to
> create Derby SQL tables "once only" during build
> and/or deployment??
> 
> The ActiveMQ code does it programmatically, but it
> seems to try it again each time during server boot.
> 

This is kind of illustrative of the problem. ActiveMQ needs a couple of 
tables as backing store but finding out whether they are there already 
is harder than it appears.

For example, you can query database metadata but for that to work you 
need to know how the catalog and schema are defined by your databases 
(setting aside minor annoyances like which case the database uses to 
store the names).

The simple but pragmatic approach ActiveMQ takes is just to create the 
tables and ignore errors that result, deferring the real failure until 
it needs to insert a message. This works for a simple schema like they 
user (I think it's just one or two tables) but is less useful for a 
complex schema like that being used by an entire application.

--
Jeremy

Mime
View raw message