Well things seem to be moving along, and I finally have tamed enough of struts, xdoclet and OJB configuration and understood enough JDO to actually get to the point where my web app tries to write to the database. (YEA!) I was not supprised however to get this exception:

java.sql.SQLException: General error,  message from server: "Table 'fdbtest2.LocationBase' 
doesn't exist"
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1825)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)

I kinda figured that I handn't yet done anything to propogate the tables into the database. XDoclet is nicely generating my repository_user.xml file, and I am wondering if there is a way to push the tables into the database (based on the repository.xml file) at runtime. Ideally, I would like the following in the end:

From my ant file;
reload (with tomcat ant task) mode.testing = true
 -  drop the test database
 -  recreate the test database
 -  create the tables
 -  run the app.

reload (with tomcat ant task) mode.testing = false
- DO NOT drop the test database
- add any tables that are missing (new classes to persist) to the database
- run the app.


The first scenario basically mirrors the unit test test database setup I think, but the second seems to require the ability to do a create if needed, which I suspect won't be easy from ant (unless I write a custom task, which is somthing I might consider doing). I am hopping that there is a nice easy way to push tables into the database (using OJB from java), if they don't exist. (but I havn't found it yet in the docs) Since It didn't jump out at me I was wondering if this is something already well know to people on this list. If I can do it via configuration settings for the OJB back end and not venture beyond the JDO API in my code that would be nice too, but I expect that that is probably asking too much.

Seeking suggestions....

Gus


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to