The issue is the following: in ma Karaf container, I have two modules, the first one is used to fetch data in the DB via a JPA interface implemented by Hibernate. Collections are fetched in a lazy way. The second module gets the object containing the collections. When trying to access elements of a collection, an error is thrown:
failed to lazily initialize a collection of role:
mapp3.model.ProductDefinition, could not initialize proxy - no Session
It has no session to access the DB and fetch the missing elements. I know in J2EE there is a concept of Sticky Session that makes a Thread create and share the same session across all beans.
It there something similar in Karaf/OSGi or is there another way of properly acheiving lazy loading between different modules ?