9 Replies Latest reply on Feb 15, 2006 9:34 AM by saviola

    jbpm 3.1 postgresql string_max

    maplat

      Hi all,

      i just tried to deploy the 3.1 release on a postgresql 8 database.

      When my software tries to create the database schema it fails with
      org.hibernate.MappingException: Could not determine type for: string_max, for columns: [org.hibernate.mapping.Column(OLDSTRINGVALUE_)]
      at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:265)
      at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:127)
      at org.hibernate.mapping.Column.getSqlType(Column.java:171)
      at org.hibernate.mapping.Table.sqlCreateString(Table.java:257)
      at org.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:658)
      at org.jbpm.db.JbpmSchema.getCreateSql(JbpmSchema.java:93)
      at org.jbpm.db.JbpmSchema.createSchema(JbpmSchema.java:187)

      I'm no hibernate expert but when i remove the string_max from the hbm files it works fine.

      Is there anything wrong in my configuration?

        • 1. Re: jbpm 3.1 postgresql string_max
          maplat

          we need to load the hibernate.queries.hbm.xml which is in the default hibernate config files.

          I had a hibernate config file of my own, where this named queries were not loaded.

          Within the named query file the type string_max is defined and then everything works fine

          • 2. Re: jbpm 3.1 postgresql string_max
            saviola

            Hi, Maplat!
            In jBPM Beta 3 the

            <typedef class="org.jbpm.db.hibernate.StringMax" name="string_max" />
            is not present.
            I am using jBPM 3.1 Final and I tried your suggestion but it failed :(
            Which version of jBPM are you using?
            Any suggestions from jBPM guys, please?

            Thanks in advance!

            Br,
            Saviola

            • 3. Re: jbpm 3.1 postgresql string_max
              maplat

              Hi Saviola,

              I'm using the 3.1 release from yesterday

              • 4. Re: jbpm 3.1 postgresql string_max
                saviola

                Hi, Maplat!
                What I did is add

                <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml"/>
                mapping to my hibernate.cfg.xml file. I use hibernate.cfg.xml of my own just like you.
                But I get the same error. Is there anything else I am supposed to do?
                Appreciate any advice!

                Thanks,
                Saviola

                • 5. Re: jbpm 3.1 postgresql string_max
                  maplat

                  Hi Saviola,

                  that's all I did.

                  I'm not sure if the order of the mapping files in hibernate.cfg.xml is important. In the original file teh queries are inserted directly below Membership.hbm.xml.

                  Are you sure, you are using the right configuration file at runtime?
                  You should be able to see this in the log files. Yust search for the name of your config file.

                  • 6. Re: jbpm 3.1 postgresql string_max
                    koen.aers

                    Have a look at the docs on switching the database. It describes how to switch to PostgreSQL. However, I just saw there are some problems with the images. Apparently the distribution released yesterday does not have this problem. We will upload the docs again.

                    Regards,
                    Koen

                    • 7. Re: jbpm 3.1 postgresql string_max
                      saviola

                      Hi, again Maplat!
                      It seems that the order of the mapping files in Hibernate.cfg.xml matters. When I moved the

                      <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml"/>
                      mapping just after the identity mappings everything went well and I succeeded in deploying.

                      Just as an additional INFO through one of my attempts I made a copy of
                      hibernate.queries.hbm.xml
                      and put it in the class path. If the queries mapping is at the mentioned position in
                      hibernate.cfg.xml
                      all was fine too, otherwise it failed again.

                      Thank you very much for your time and for your fast replies! Have a nice day!

                      Regards,
                      Saviola

                      • 8. Re: jbpm 3.1 postgresql string_max
                        ivanflorentin

                        Hi Saviola, Maplat,

                        I'm using Jbpm 3.1 with jboss-4.0.4rc1 and jboss-seam beta2, I'm using container managed persistence with ejb3.0RC5 and even if I followed your solution, I coudn't make it work, details on the problem are here:
                        http://www.jboss.com/index.html?module=bb&op=viewtopic&t=77449

                        as far as I understand, hibernate.queries.hbm.xml is needed for jbpm to work properly.

                        Thanks for your help

                        • 9. Re: jbpm 3.1 postgresql string_max
                          saviola

                          Hi, Ivanflorentin!
                          What I can say for sure is that if you use jBPM 3.1 Beta 3 or jBPM 3.1 Final (I've tested with them only) you will definitelly need hibernate.queries.hbm.xml because the named queries that JbpmContext uses for its common methods like (get all process definitions for example) are defined in this file.
                          You can see

                          graphSession.findAllProcessDefinitions()
                          method.

                          Regards,
                          Saviola