3 Replies Latest reply on Mar 6, 2002 3:26 PM by dsundstrom

    JAWS and schema changes


      I'm interested in understanding how to perform schema changes (most notably the addition of new fields) with JAWS, without interrupting service. The information that I've seen so far suggests that the only strategies are:

      - Let JAWS drop the table (and thus destroy the data that it contains) automatically when it needs to replace it, or

      - drop the table manually (presumably after having saved the data somewhere else), let JAWS build the new table then reload the data, somehow.

      This latter strategy certainly preserves data, but defeats one of JBoss' strongest features, that of auto-deployment. It appears that this could not be performed without an interruption to service of some duration, particularly if there are a large number of rows in the affected tables.

      Is there a better way? Are there plans to extend JAWS to include "migration assistance" classes to handle this sort of change?

        • 1. Re: JAWS and schema changes

          I don't think there are any plans to extend JAWS to be a full featured database design tool, there are plenty of them. The auto-create features are intended to be a convenience for developers, and there is an expectation that for production your dba will at least review the schema and presumably add indices, assign tablespace, etc etc so you have some chance of reasonable performance.

          There's nothing stopping you from preparing a db migration script yourself if you want to change the table structure. Many db design tools will generate a script that will preserve the existing data even for rather complicated changes. I usually prefer to do it myself so I'm sure of what is going on.

          • 2. Re: JAWS and schema changes

            I am a experienced Oracle developer and I'd like to do some work on schema (cmp->db) sync, primarily add/drop columns.

            How can I contribute the code to CVS ?

            • 3. Re: JAWS and schema changes

              JAWS will eventually be completely replaced with JBossCMP, so new advanced features aren't really being added to JAWS.

              I have thought about for this for a couple of hours now and I have to admit that at first I thought this was a terrible idea. I think it would be cool to have a couple of entity level options to add-missing-columns and drop-unused-columns. I think that the former will be more useful then the latter, but if you are doing one the other is very simple.

              All table creation in JBossCMP takes place in org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand. When you get a patch ready post it at sourceforge and I'll test it with PostgreSQL and Hypersonic.

              If you run into problems, send me an email. My email address is at the top of that file.