tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwaastad <he...@waastad.org>
Subject Re: deltaspike fullstack example
Date Fri, 03 Oct 2014 11:17:28 GMT
Hi Romain,
Just a small check with you before a start digging into DS and
entitymanager.

Container-managed entitymanager:
   @PersistenceContext(unitName = "ValidationPU")
    private EntityManager entityManager;

    @Produces
    EntityManager createEntityManager() {
        System.out.println("Producing entitymanager.....");
        return this.entityManager;
    }

Application managed entitymanager:
    @Produces
    @ApplicationScoped
    public EntityManagerFactory createEntityManagerFactory() {
        System.out.println("Producing EMF......");
        return Persistence.createEntityManagerFactory("ValidationPU");
    }
   @Produces
    public EntityManager createEntityManager(EntityManagerFactory
entityManagerFactory) {
        System.out.println("Producing entitymanager.....");
        return entityManagerFactory.createEntityManager();
    }

If I'm correct, it seems that DS validation does not work with CM-EM but OK
with AM-EM.
In that case I'll continue my discussions with DS.

br hw






--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/deltaspike-fullstack-example-tp4672086p4672105.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Mime
View raw message