myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gernot <gern...@nurfuerspam.de>
Subject CODI: Wiki "JPA Usage"
Date Mon, 01 Aug 2011 15:38:22 GMT
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

Mime
View raw message