K
kandlinger
Hi all,
I read that the container managed entity managers are not only working
in EJBs but also in Beans listed in the faces-config.xml. I used a
manual created entity manager with success in my JSF application. But
now I reached a point where a container-managed entity manager would be
nice. Because the entity manager needs to survive the whole session,
and so i cannot close him. So I tried to use a container-managed one
with the following code:
@PersistenceContext(unitName="persistence_unit")
protected EntityManager em;
The problem is, that this container-managed entity-manager doesn't
work. I doesn't connect to the database i specified in persistence.xml.
It always wants to connect to the derby-database shipped with the sun
appliction server 9. But the manual created entity managers are using
the database server I specified in persistence.xml.
Anybody knows the solution ?
Is it correct to place the persistence.xml in
/WEB-INF/classes/META-INF/persistence.xml inside the .war file ?
I read that the container managed entity managers are not only working
in EJBs but also in Beans listed in the faces-config.xml. I used a
manual created entity manager with success in my JSF application. But
now I reached a point where a container-managed entity manager would be
nice. Because the entity manager needs to survive the whole session,
and so i cannot close him. So I tried to use a container-managed one
with the following code:
@PersistenceContext(unitName="persistence_unit")
protected EntityManager em;
The problem is, that this container-managed entity-manager doesn't
work. I doesn't connect to the database i specified in persistence.xml.
It always wants to connect to the derby-database shipped with the sun
appliction server 9. But the manual created entity managers are using
the database server I specified in persistence.xml.
Anybody knows the solution ?
Is it correct to place the persistence.xml in
/WEB-INF/classes/META-INF/persistence.xml inside the .war file ?