dev@glassfish.java.net

How to detect from-version during upgrade?

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Thu, 26 Aug 2010 12:46:54 -0700

Is it possible to identify the original version of the domain during the upgrade processing?

This is my problem:
a) To be able to correctly (and easily) delete EJB timers on undeploy, I'd need to add an extra column to the timer table (to store the application id, which is the only thing available to me during the clean() phase of undeploy).

b) The timer table already got a new column in v3 (to store the schedule data), and the upgrade code in v3 was added to execute an ALTER TABLE sql.

But now I would need to distinguish between upgrade from v2 (add 2 colums) and upgrade from 3.0/3.0.1 (add only 1), and checking DatabaseMetaData is not an option because the catalog/schema/tablename combination are handled by the JPA provider (and can be theoretically modified by the user, via JPA mapping descriptor).

Any suggestions are appreciated ;)

thanks,
-marina