0 Replies Latest reply on Aug 11, 2009 3:40 AM by Parragh Szabolcs

    Triggering schema generation at deploy

    Parragh Szabolcs Newbie

      Hi guys,
      I guess I'm asking an obvious question, for what unfortunately I couldn't find the answer--and I really tried, googled, searched the forum etc. Please, someone help me out a bit!

      I making an EJB app, a module of wich has jBPM functionality (version 3.3.1). I really would like to make it to create the DB schema at deploy time. The ear is configured like this:

      ----- client.war
      ----- mainapp-module.jar
      ----- jbpm-module.jar
       ------- META-INF/persistence.xml
       ------ hu.... (classes)
       ------ hibernate.cfg.xml

      The configuration is placed properly, because if I create the DB schema by hand, the app runs perfectly.

      In my hibernate.cfg.xml I have (tried "create" too):

       <!-- Automatic schema creation (begin) === -->
       <property name="hibernate.hbm2ddl.auto">update</property>
       <!--==== Automatic schema creation (end) -->

      The persistence.xml file has the same row in it.

      With this code, if I deploy the app nothing happens (the schema for the JPA entities is generated only). This setup makes the schema generation happen at the first call to the SessionBean that has the jBPM code in it (which fails due to calling commit in a transaction).

      I would like to have the jBPM schema generation triggered at deploy time, but cannot make it happen. Could someone please point me to the right direction?

      Thanks a lot!