openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthieu Riou" <matthieu.r...@gmail.com>
Subject Entity manager injection
Date Fri, 02 Mar 2007 16:32:19 GMT
Hi,

For ODE we're managing our transactions ourselves. We start them and commit
them explicitly. By the same token we create the EntityManagerFactory
ourselves. Is there a possibility to use the EntityManager injection in the
persistent classes in this context or do we have to implement our own
ThreadLocal based thingy to have the EM available in our persistent classes
using it?

I've tried doing something like:

1. Adding "@PersistenceContext  private EntityManager _em;" in a persistence
class.
2. Load the persistence class from an EntityManager created with the
factory.
3. Use _em in my persistent class
       => NullPointerException

Thanks,
Matthieu

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message