Hibernate OSGi race-condition prevents registering persistence-enabled services

Description

Randomly, my PU bundle doesn't start its services because it keeps waiting on the Hibernate OSGi services availability.

This has been discussed with Brett Meyer, who has also identified this in the official Hibernate OSGi example code (https://github.com/hibernate/hibernate-orm/blob/master/documentation/src/main/docbook/quickstart/tutorials/osgi/managed-jpa/features.xml#L65).
Brett has managed to workaround this issue by forcing the start-level of some bundles, but this is not possible in Fabric8, and is not fully compliant with what OSGi proposes as modular design.

I'm providing example code that you can easily get up and running and see for yourselves. All you need is Java 7, Maven 3.1.x and to download fabric8-karaf-1.0.0.redhat-340. Instructions are available and have been tested!

Environment

Mac OS X: 10.8.5
Hibernate version: 4.2.7 (4.2.8 doesn't seem to like OSGi, thanks to HHH-8779)
Database: HSQLDB (in-memory)
OSGi environment: Fabric8 1.0.0.redhat-340 + Karaf 2.3.0.redhat-340

Status

Assignee

Brett Meyer

Reporter

Paulo Pires

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major
Configure