I think it's safe to say that Hibernate is currently incompatible with OSGi. I see at least two reasons:
- Hibernate uses the thread context classloader, a concept that does not work* in OSGi environments. The Apache Felix mailing list contains many topics like "Library X doesn't work in OSGi" and almost every time it's that drat thread context classloader.
- In a hypothetical Hibernate bundle, the DriverManager would use the bundle's class loader to load JDBC drivers, which means that the Hibernate bundle would have to "import-package" the driver packages. Ugly.
*Equinox and Spring-DM
try to work around this issueI think our best bet is to plead with the Hibernate developers for "osgification" of our favorite ORM library. ;-)