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 17:46 Go to next message
John Steele is currently offline John Steele
Messages: 49
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 08:47 Go to previous message
Eduardo Frazão is currently offline Eduardo Frazão
Messages: 118
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 08: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: Sun Apr 20 12:31:51 EDT 2014

Powered by FUDForum. Page generated in 0.01509 seconds