Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Combining Persistence Bundles
Combining Persistence Bundles [message #1059558] Mon, 20 May 2013 13:00 Go to next message
Florian Pirchner is currently offline Florian PirchnerFriend
Messages: 94
Registered: July 2009
Member

Hi,

right now i was reading Compendium Spec 5.0 and hoped to find a solution about combining persistence bundles.

I would like to provided entities contained in different bundles by one EMF. For now it is not possible. All the entities have to be contained in the same bundle.

I am looking forward to install new bundles providing entities in runtime mode. They should join the "referenced" persistence context. I now that this would require a "pre bytecode weaving" so that all the entities are "ready" for its use in the persistence context and no restart of persistence bundle has to be performed.

A solution might be using fragments. But they do not provide its own lifecycle.

1) Is there a way using gemini propietary API to do this?
2) Are there any intentions by OSGi to provide a way? Maybe with the new subsystem specification?

Thanks Florian
Re: Combining Persistence Bundles [message #1059854 is a reply to message #1059558] Tue, 21 May 2013 23:30 Go to previous messageGo to next message
Michael Keith is currently offline Michael KeithFriend
Messages: 243
Registered: July 2009
Senior Member
Hi Florian,

We have plans in Gemini JPA to provide support for multiple bundles but it will not be as dynamic as you described. All of the bundles required for a given persistence unit will need to be available in order to start using the persistence unit.

If you want entities to be added dynamically then you might want to take a closer look at the EclipseLink dynamic entities feature:

http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic

I haven't tried using this with Gemini JPA, but I don't think there should be any problems since it is not a matter of classloading but is all runtime jiggery-pokery. Take a look and post whether it meets your need or not.

There are no plans for OSGi to extend the JPA spec to provide any such extended functionality.

-Mike
Re: Combining Persistence Bundles [message #1059855 is a reply to message #1059854] Tue, 21 May 2013 23:34 Go to previous messageGo to next message
Michael Keith is currently offline Michael KeithFriend
Messages: 243
Registered: July 2009
Senior Member
I just remembered, you will want to use the dynamic entity API rather than the declarative virtual entities, so there is some classloading going on with the class generation, but at least you can pass in the "right" classloader.

-Mike
Re: Combining Persistence Bundles [message #1059905 is a reply to message #1059855] Wed, 22 May 2013 07:10 Go to previous message
Florian Pirchner is currently offline Florian PirchnerFriend
Messages: 94
Registered: July 2009
Member

Hi Mike,

thanks. I took a deep look into the dynamic entity API last days. Seems to be an interesting approach.
So it should be possible to extend a PersistenceUnit with new entities at runtime.

I will follow your idea and do some more tests...

Best and thanks
Florian
Previous Topic:[Solved] Blueprint installation on another server (Jboss AS 7)
Next Topic:[Blueprint reference-list] Retrieve ServiceReference with reference-listener
Goto Forum:
  


Current Time: Fri Apr 26 19:42:24 GMT 2024

Powered by FUDForum. Page generated in 0.03042 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top