3 Replies Latest reply on Oct 7, 2011 3:07 PM by swiderski.maciej

    Regarding Persistence.xml

    snyperboss

      Hello All

       

      I find the details of the db used by JBPM is inside a jar in Persistence.xml.

      What if I have multiple environments with each environment pointing to a different db.

      In this scenario, am I supposed to modify the jar for each environment? Is there any way to move it outside to a properties file.I tried overriding the persistence file by putting a new one in the class path, but it still picks up from the jar.

       

      Please help.

       

       

      Thanks!

        • 1. Re: Regarding Persistence.xml
          swiderski.maciej

          persistnce.xml file defines persistence units so you can define your one persistence unit in another file and put it on classpath. Just make sure you have different names in every persistence unit you have including the one shipped with jBPM.

          Next refer to your persistence unit (by name) when creating entity manager factory prior to creating the session.

           

          HTH

          • 2. Re: Regarding Persistence.xml
            snyperboss

            Thanks!

             

            The persistence.xml started getting picked up after putting it in a MEAT-INF folder in the classpath.

            I setup the new persistence.xml to point to mysql, but every time I restart my task server, I find my old pending task getting wiped off

            from the db i.e. from the task table.

             

            How can I prevent this and make sure that the human task assigned to a user is recoverable to the previous state on a server restart?

             

            Thanks!

            • 3. Re: Regarding Persistence.xml
              swiderski.maciej

              It is probably because of following property inside persistence.xml of task service:


              <property name="hibernate.hbm2ddl.auto" value="create" />
              
              

              change the value to update or verify once the db was successfully created.

               

              HTH