5 Replies Latest reply on Feb 14, 2013 8:17 AM by shijuj

    JBPM 5.2 in DB2 - Sequence generation problem

    shijuj

      Hi

       

      Currently i am using oracle DB. I am try to change the database to DB2.

      In oracle, Session id generated using the sequences SESSIONINFO_ID_SEQ. But in DB2 the same sequence is not working .

      Due to that problem knowledge session persistence is not working.

       

      Please help?

        • 1. Re: JBPM 5.2 in DB2 - Sequence generation problem
          jsvitak

          Hello,

           

          try to add the following property into your persistence.xml file:

           

          <property name="hibernate.id.new_generator_mappings" value="false" />

          • 2. Re: JBPM 5.2 in DB2 - Sequence generation problem
            shijuj

            Hi jiri Svitak,

            Thanks for ur replay. This is not working.  In oracle am using the sequence name SESSIONINFO_ID_SEQ

            But in DB2 the same sequence is not taken for sessioninfo table. My Persistance.xml look like

             

             

             

             

             

             

             

             

             

             

             

            <properties>

             

            <property name="hibernate.dialect"
            value="org.hibernate.dialect.DB2Dialect"/>

             

            <property name="hibernate.id.new_generator_mappings" value="false"/>

             

            <property name="hibernate.connection.autocommit" value="false"/>

             

            <property name="hibernate.max_fetch_depth" value="3"/>

             

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

             

            <property name="hibernate.show_sql" value="false"/>

             

            <property name="hibernate.transaction.manager_lookup_class" value="com.TransactionManagerLookup" />

             

            </properties>

            • 3. Re: JBPM 5.2 in DB2 - Sequence generation problem
              jsvitak

              Hello,

               

              have you tried to recreate the schema (delete and create again) with the new settings? Which version of Hibernate and JBoss AS do you use? Sequence generation problem appeared after migration to Hibernate 4, now it's fixed in in jBPM 5.4. But it's possible that you face a different issue.

              • 4. Re: JBPM 5.2 in DB2 - Sequence generation problem
                shijuj

                Hi,

                 

                Am Using Hibernate 3 and JBoss 4. yes I recreated all the schema. but its not working.

                Am  trying with option <property name="hibernate.hbm2ddl.auto" value="create"/> then it is working.

                But in this case also DB doesn't have a sequence named SESSIONINFO_ID_SEQ but its working properlly.

                 

                 

                • 5. Re: JBPM 5.2 in DB2 - Sequence generation problem
                  shijuj

                  Hi jiri Svitak,

                  Thankyou very much for ur support.

                  The issues got solved. Now change the sequences to identity in DB2.