geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Boynes <>
Subject Re: CMP tables - can they be created automatically?
Date Tue, 05 Jul 2005 16:07:00 GMT
Jacek Laskowski wrote:
> Hi,
> Just wondering if there's a way to automatically generate tables for 
> CMPs. Do I need to create them manually? I wish I wouldn't have to.

It really depends on how far you want to go with generating the schema.

It is fairly easy to do basic generation, executing DDL to create the 
tables. This can work well in a development environment where there is 
no DBA support for Java developers.

However, one challenge comes when you want to run this the second time. 
There are basically two options: drop and rebuild the database, or issue 
alter statements to modify the schema to match the new object model. The 
first works well with small databases (few tables, sample/test data) but 
not with large ones. The second is complex to get right - many database 
specific modelling tools have struggled with this problem over the years.

For a production environment a whole other set of issues arise:
* avoiding being killed by the DBAs
* table/column design rules
* having permission to issue DDL statements at all
* avoiding being killed by the DBAs
* physical database design issues (e.g. which tablespace/segment)
* index generation and other tuning
* avoiding being killed by the DBAs

I'm not trying to raise barriers here, but this is something I have run 
into before and just want to make sure some of the non-technical issues 
are flagged up front.

TranQL has models of the various schema levels involved and we are 
starting to see the emergence of database specific behaviour (Derby and 
now DB2 dialects). Given it knows what the physical schema looks like, 
it should be possible for it to convert that to DDL.

I think the place to start is to add a DDL generation module to TranQL 
which initially can generate a script containing appropriately ordered 
DDL statements that can be run using the database's tools, maven or ant. 
Once that is there, having the server execute it automatically should be 
a firly trivial task.


View raw message