I tried "Using one (default) Entity Manager"
(https://cwiki.apache.org/confluence/display/EXTCDI/JPA+Usage):
public class DataBaseProducer
{
    @Produces
    @PersistenceContext(unitName="default")
    @Default
    private EntityManager entityManager;

    public void dispose(@Disposes @Default EntityManager entityManager)
    {
        if(entityManager.isOpen())
        {
            entityManager.close();
        }
    }
}

This does not work - I get following error at "@Disposes" in eclipse:
"There is no producer method declared by the (same) bean class that is
assignable to the disposed parameter of a disposer method [JSR-299
ยง3.3.7]"

Whats wrong?

thx, gernot

Reply via email to