John,

Here is how I create it:

@ApplicationScoped
public class JdoEntityManagerProducer {
  private final PersistenceManagerFactory gctrackJdoFactory =
JDOFactory.getFactory();

  @Produces
  @GCTrack
  @RequestScoped
  protected EntityManager create() {
    return new JdoEntityManagerImpl(gctrackJdoFactory.getPersistenceManager());
  }

  protected void closeEntityManager(@Disposes @GCTrack EntityManager
entityManager) {
    if (entityManager.isOpen()) {
      entityManager.close();
    }
  }
}


here is how I inject it

@Inject @GCTrack private JdoEntityManager entityManager;



On Sun, Jan 17, 2016 at 6:12 PM John D. Ament <[email protected]> wrote:

> Hi Alex,
>
> Just want to check, your usecase is something like
>
> public interface MyEntityManager extends EntityManager {
>
> }
>
> but then how are you creating instances of this object?
>
> John
>
> On Sun, Jan 17, 2016 at 5:45 PM Alex Roytman <[email protected]> wrote:
>
> > It looks like of a bean is injected with a field of type not
> EntityManager
> > but an interface extending it, transactional annotation does not work. Is
> > there any way to have transactional to recognize interfaces that extend
> > from EntityManager
> >
> > Thanks
> > Alex
> >
>

Reply via email to