How To: Promoting a jVantage Application to Production
From jVantage
In a typical software development organization, the life cycle that software follows from development to production, or to a General Availability (GA) release is as shown in the diagram below. There are many possible variations on this model, but overall, most software releases follow this general flow.
Virtually all software applications of any significant complexity or size are generally made up of three broad artifact types:
- Programs that embody the functional aspects of the application itself, such as one or more Java class files.
- Configuration files, which are typically modified to reflect the installation environment, such as where to write log files or how to contact a database. For instance, a given application is built using a development database, which is a facsimile of a production database. Later, upon installation into a production environment, configuration files accompanying the application will be modified to cause the application to utilize the real production database for business critical operation.
- Data, which is usually housed in a relational database, such as DB2, MySQL or Derby.
Applications developed with jVantage are no different. The three bounding boxes in the following diagram show how jVantage artifacts align with the three categorizations above.
Note: Although an import/export capability is in the works for a future release of jVantage that will automate much of this, at present promoting jVantage applications is a manual process (as it is with any other type of application).
Initial Installation
If you are installing your jVantage application into an environment where it has not been installed before where there is no existing, prior version of the application, the following steps are required. If you need to apply changes to an existing jVantage application, refer to the section below, Promoting Application Updates to an Existing Environment.
- Install jVantage in the target environment as usual.
- Export the jVantage database in the target environment to preserve the RootContext configuration data.
- Export the database from the development environment.
- Drop all tables and sequences from the database in the target environment that were generated during the jVantage install.
- Edit the export jVantage SQL file and remove the ROOTCONTEXT-related statements.
- Execute a batch load of the exported SQL files using a database client that comes with (or, at least works with) your database.
- Restart your application server.
Install jVantage
Install a clean instance of jVantage on the target server. Be sure that the version of jVantage you install matches the development version. Detailed instructions for installing jVantage can be found here.
Export the jVantage Database from the Target Environment
As a precautionary step, you should first export the jVantage application from the target environment after installation of the new jVantage image. Although the data can be easily recreated if needed by running setup again, it may be handy if you accidentally delete the wrong tables later in this process. Here's how.
In the target environment, login to jVantage and select the jVantage application from the application list as follows:
From the jVantage application context, select Export Database.
On the subsequent page, select your database vendor and submit (Target Environment).
jVantage will then generate an SQL file in the directory <Configuration Directory>/db_export/jvantage_mysql_<timesamp>.sql. The configuration directory can be determined from the Root Context page (see the example above); this is the directory you specified during setup. Given the Root Context example on this page, the file is written with the following path and name:
C:/jvantage/db_export/jvantage_mysql_20070322_1714.sql
Export the jVantage Database from the Development Environment
Follow the steps above in your development environment, with the exception that on the Database Export page, select the Export All Applications option.
Drop All Database Tables in the Target Database Except ROOTCONTEXT
Now, open a database client such as the MySQL Query Browser (if you're using MySQL) and drop all the tables that were created during the jVantage setup process except ROOTCONTEXT. Again, be absolutely sure that you are working in the target environment.
Edit the jVantage SQL File
When jVantage exports a database, it exports the entire database for the given application. Since jVantage is, itself, a jVantage application, this means that it exports its own meta information. The problem is that the ROOTCONTEXT table is specific to the environment that the jVantage instance is running in. This means that we must preserve this table in the target environment. Doing so if quite easy, but it is a manual step.
Open the <Configuration Directory>/db_export/jvantage_mysql_<timesamp>.sql file that was generated from your Development Environment with a text editor and search for the string; CREATE TABLE ROOTCONTEXT.
Remove this line and the subsequent line as shown below.
CREATE TABLE ROOTCONTEXT... INSERT INTO ROOTCONTEXT...
Save the file.
Load the SQL Files into the Target Database and Restart your Application Server
Now, you must load each of the SQL files exported from your Development Environment into the Target Database. In the MySQL Query Browser, do this by executing File | Open Script... for each SQL file you exported.
Promoting Application Modifications into an Existing Environment
@TODO







