Version 16

    JBoss-Hibernate Integration (Switching Hibernate Versions)

    - Steve Ebersole, JBoss Inc

     

     

     

     

    -


    Within JBossAS, all Hibernate version-2 vs. version-3

    dependencies are isolated to the deploy/jboss-hibernate.deployer

    archive (exploded by default).  In general, switching between

    Hibernate2-based integration and Hibernate3-based integration

    is as simple as dropping in the appropriate version of the

    jboss-hibernate.deployer.

     

     

     

     

    Note that if you are planning on using the Hibernate3-based

    integration for an application initially developed to use

    Hibernate2, make sure you understand the implications of a

    migration from Hibernate2 to Hibernate3.  Be sure to read

    the migration guide

     

     

    -


    Switching from Hibernate3 to Hibernate2

    This should mainly be users of JBossAS 4.0.2 and later (or

    perhaps users reversing a previous switch from Hibernate2 to

    Hibernate3), wanting to use Hibernate2 instead of Hibernate3.

     

     

     

     

    Simply delete the existing deploy/jboss-hibernate.deployer from

    your system and drop in the Hibernate2-based jboss-hibernate.deployer.

    The Hibernate2-based deployer archive is contained within the attached

    file named hibernate2-deployer.zip.  Note that this version bundles

    Hibernate version 2.1.8, and is based on JBoss version 4.0.2RC1.

     

     

    -


    Switching from Hibernate2 to Hibernate3

    This should mainly be users of JBossAS 4.x prior to 4.0.2 (or

    perhaps users reversing a previous switch from Hibernate2 to

    Hibernate3 in JBossAS version 4.0.2 and later) who want to upgrade to use Hibernate3 but not upgrade to JBossAS 4.0.2 or higher.

     

     

     

     

    Again, simply delete the existing deploy/jboss-hibernate.deployer from

    your system and drop in the Hibernate3-based jboss-hibernate.deployer.

    The Hibernate3-based deployer archive is contained within the attached

    file named hibernate3-deployer.zip.  Note that this version bundles

    Hibernate version 3.0.3.

     

     

     

     

    An even better choice, here, is to obtain the JBoss source,build the

    hibernate module, and use the resulting jboss-hibernate.deployer

    archive for your drop-in as that will give you the most up-to-date

    version.

     

     

    -


    Using Hibernate3 to Hibernate2 Simultaneously

    Using the integration for both Hibernate2 and Hibernate3 simultaneously

    is a bit more complicated.  You need to make certain you are using the deployer-less versions of both the Hibernate2 and Hibernate3 integration modules.  The deployer-less code for Hibernate3 is the source currently in JBoss CVS.  The source for Hibernate2 deployer-less integration is attached below as hibernate2-no-deployer-src.zip (see the docs for the Hibernate3 deployer-less integration as the attached functions in a similiar fashion).  The attached package additionally renames the package to org.jboss.hibernate2... to avoid namespace issues.

     

     

     

     

    -