Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Access EntityManagerFactory from Declarative Service?(How to specify persistence unit within OSGi declarative service.)
Access EntityManagerFactory from Declarative Service? [message #837592] Thu, 05 April 2012 21:46 Go to next message
John Steele is currently offline John SteeleFriend
Messages: 50
Registered: January 2010
Member
To help manage the dynamic EntityManagerService provided by Gemini JPA, I would like to use OSGi declarative services instead of using a ServiceTracker. Can this be achieved? I need to somehow specify the persistence unit, so that I get the corrent EntityManagerFactory service. Any ideas?

Thanks,
John Steele
Re: Access EntityManagerFactory from Declarative Service? [message #839935 is a reply to message #837592] Mon, 09 April 2012 12:47 Go to previous message
Eduardo Frazão is currently offline Eduardo FrazãoFriend
Messages: 123
Registered: January 2012
Senior Member
On DS, must be something like:

<reference name="EMF"
  interface="javax.persistence.EntityManagerFactory"
  cardinality="1..1"
  target=(osgi.unit.name=YourPUName)
  policy="dynamic"/>


[Updated on: Mon, 09 April 2012 12:48]

Report message to a moderator

Previous Topic:Persistence Context caching and synchronization
Next Topic:Implementation of OSGi Enterprise Transaction Service
Goto Forum:
  


Current Time: Tue Mar 19 09:14:39 GMT 2024

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

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

Back to the top