OK. So just to confirm that things are still the same. I know that unit names need not be unique, so I assume you still generate the unique ID suffix. How does OpenEJB then decide what to do with it. I tried looking around the code, but am a bit lost on where it injects these entity managers and how it decides which persistence unit to use. Could you perhaps tell me where to find this?
Quintin Beukes On Thu, Oct 15, 2009 at 5:33 PM, Jean-Louis MONTEIRO <[email protected]> wrote: > > Hi Quintin, > > you can use JNDI to get a reference. > Have a look here > http://www.nabble.com/Lookup-EntityManager-from-Stateless-EJB-Session-Bean-td24708299.html#a24737449 > http://www.nabble.com/Lookup-EntityManager-from-Stateless-EJB-Session-Bean-td24708299.html#a24737449 > > Hope it helps. > Jean-Louis > > > Q Beukes wrote: >> >> Hey, >> >> When I have an EntityManager injected while having multiple >> persistence units, I do it by specifying the unit name, something >> like: >> @PersistenceContext(unitName="Some-PU") >> private EntityManager em; >> >> Is it possible to do this not by injection, but fetching it by name >> through an API of some sort? >> >> Quintin Beukes >> >> > > -- > View this message in context: > http://www.nabble.com/Fetching-a-Persistence-Context-tp25910491p25910759.html > Sent from the OpenEJB User mailing list archive at Nabble.com. > >
