users@jersey.java.net

Jersey and JPA best practices?

From: Florian Hars <hars_at_bik-gmbh.de>
Date: Thu, 18 Dec 2008 10:46:43 +0100

What is the best way to use jersey with JPA?

I found most of the necessary magic incantations (like the
WEB-INF/classes/META-INF/persistence.xml madness and telling glassfish
not to throw "java.lang.AbstractMethodError:
org.postgresql.jdbc3.Jdbc3Connection.getClientInfo()Ljava/util/Properties"
by setting JDBC30DataSource to true in the properties of the pool) and now I
can ask Persistence to give me an EntityManagerFactory and it will do so.

But what is the best way to manage these ManagerFactories and their assorted
Managers? I can't seem to find the right set of annotations to get
container managed persistence to work, do I have to write my own
EntityManagerFactoryManager?

Any hints/tips/experiences?

- Florian.