I manage to issue a Liquibase Update as described in Liquibase Servlet Listener.
<listener>
<listener-class>liquibase.servlet.LiquibaseServletListener</listener-class>
</listener>
This effectively executes my Changelog.
However, this happens after the setup of the EntityManager. Obviously, this is too late if I want my Persistence provider to validate the database schema:
<property name="hibernate.hbm2ddl.auto" value="validate"/>
... the tables simply do not exist yet.
Is there a way I can make Liquibase to Update the database schema, before the EntityManager is initialized?
PS:AppServer is JBoss6
=========================[ UPDATE ]===========================
Based on the brief discussion with Nathan below, I may have to rephrase the question as follows:
Does anybody know a code hook in the JBoss startup sequence before the initialization of the EntityManager?
If that exists, I can move the Liquibase update logic to that place?