5 Replies Latest reply on Jul 13, 2009 1:49 AM by Adam Warski

    Using Hibernate 3.5-SNAPSHOT

    Jamie Bisotti Newbie

      I'm thinking about using Hibernate's 3.5-SNAPSHOT in order to get the latest and greatest Envers updates but I have a couple of questions:

      1. How frequently are SNAPSHOT builds updated in the public repository (http://repository.jboss.com/maven2)? The most current one there is from the end of April. I'm guessing a lot has chanced between then and trunk.

      2. If SNAPSHOTs are not frequently updated, are there publicly available nightly builds?

      3. Any reason you are aware of to NOT use 3.5-SNAPSHOT?

      4. This isn't really related to 3.5-SNAPSHOT...I don't see anything in JIRA related to porting EnversHibernateToolsTask to the standard HibernateToolsTask. That will be done, right? Any idea when? Personally, creating the audit schema was a pain.


      Thanks,
      Jamie

        • 1. Re: Using Hibernate 3.5-SNAPSHOT
          Adam Warski Master

          Hello,

          to get the latest&greatest Envers updates you can simply use the Hibernate-3.3 compatible branch of Envers: any changes from trunk are merged there. Also, the recently release Envers 1.2.1 has all the updates.

          Regarding your questions:
          1. When somebody writes "mvn deploy" or sth similar :)
          2. I don't know, maybe Hibernate has some, look at the Hibernate website
          3. Envers is stable, don't know about Hibernate
          4. I don't quite understand ... why did you have to create the schema? And why was it a pain?

          Adam

          • 2. Re: Using Hibernate 3.5-SNAPSHOT
            Jamie Bisotti Newbie

            Adam,

            Regarding #4...I needed to get the _AUD tables created in my DB. I typically let Hibernate create/update my schema for me, but it does not currently add the _AUD tables. How do you suggest getting them in my database? Am I missing somthing?

            Thanks,
            Jamie

            • 3. Re: Using Hibernate 3.5-SNAPSHOT
              Adam Warski Master

              Well, that's what the EnversHibernateToolTask was created for. Are you not able to use it? Unfortunately the regular one doesn't provide any hooks to execute additional actions, so I had to subclass it.

              Adam

              • 4. Re: Using Hibernate 3.5-SNAPSHOT
                Jamie Bisotti Newbie

                Adam,

                Turns out, I did not need to manually create and apply the schema. I could swear (though I'm too lazy to go back and actually verify) that when I was using Hibernate 3.3 + Envers 1.2.0 none of my audit/history tables were being created "automagically"; though now with Hibernate 3.5-SNAPSHOT, they are. It took a while to figure out that they were because our project is using the Firebird DB, which apparently has a table name length restriction that's pretty small. So, Hibernate/Envers were trying to create the audit/history tables (and did create some of them) but the name's of some of the tables were too long and the creation was failing...silently. So, it's all good now.

                One question though: How does Hibernate know to use EnversHibernateToolTask?

                Thanks,
                Jamie

                • 5. Re: Using Hibernate 3.5-SNAPSHOT
                  Adam Warski Master

                  Hello,

                  you mean the hbm2ddl setting? It doesn't use the tool task, it just looks at what classes are mapped in the configuration. So adding the listeners is enough to let Hibernate know about the additinal tables.

                  Adam