Discussions

News: Creating OSGi bundles for Hibernate 3.5.x for use with JPA 2.0

  1. Recently I tried to modify an existing JPA 2.0 web application for OSGi deployment. Among the various challenges I encountered was the lack of OSGi bundles for Hibernate 3.5.x.

    Finally, I decided to create them myself. Below is a link to a blog post I made that describes the process of OSGi-fication of Hibernate 3.5.x.

    Creating custom Hibernate OSGi bundles for JPA 2.0

    The full source of the all the bundle wrappers & the source of a small demo project (wicket/spring/hibernate/jpa2/osgi) that uses these bundles, can be found in this follow up post.

    Wicket, Spring 3, JPA2 & Hibernate OSGi Application on Apache Karaf

    I hope you find this usefull.

    Note: That the demo application, has just the purpose to present an example usage of the custom Hibernate bundles. It does not demonstrate best practises, patterns etc.

     

  2. Well, that seems like a lot of trouble. Why wouldn't you just use a JPA 2.0 provider like EclipseLink that already has an OSGi bundle distribution?

  3. Well, that seems like a lot of trouble. Why wouldn't you just use a JPA 2.0 provider like EclipseLink that already has an OSGi bundle distribution?

     

    Hi Mike,

    It is a lot of trouble! And this is why I decided to make a post about it!

    As I mentioned in the original post, I tried to migrate an existing application, so hibernate 3.5 was already there.

    Things could have been more easy, if I used EclipseLink or Open JPA, however my goal was not to present the easiest way, but to present what to do when you have to go with hibernate 3.5.