Another bundle B uses this service to retrieve an EntityManager and to
persist class C (which is located in bundle B and which package is just
private).

This is not going to work. B must export the package C is in.

So bundle A knows nothing about class C, the EntityManager is created
with not knowing about C too. The consequence is that the EntityManager
don't persist C because C is not enhanced.

hmm, i think that actually the EM is not going to persist C because it doesn't know its class. Enhancing can be a problem though, because this is done on a classloader and because of Murphy's laws, probably on the wrong one. And then there is the issue that you might be too late and somebody is already using the non-enhanced classes. I did a lot of debugging with OpenJPA to find out how this all works, and my conclusion is that trying to make enhancing on the fly work, is not worth the trouble. Just enhance the classes compile time. Of course, this has the disadvantage that you "sneak in" dependency on OpenJPA (in the sense that it is only going to work with the OpenJPA persistence provider), but i can live with that.


Hth.
Regards,
Peter.

We found out that with BuddyPolicy from equinox-framework, things get
work. But we don't want to have framework-specific things.
Another possibility is using 'DynamicImport-Package: *' in bundle A and
to export class C in bundle B - but thats an option, which we consider
to be dirty.
We played with classloading-mechanism, but those games didn't work.

So, how do other people use (Open)JPA within OSGi? Is it maybe better,
to switch to Hibernate with database XXX?

Yet, there must be a solution for it!?

Thanks for reply,
Kevin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to