users@jersey.java.net

RE: [Jersey] Jersey and JPA best practices?

From: saturon <netbeans_at_vtxfree.ch>
Date: Fri, 19 Dec 2008 11:37:41 +0100

Hi Florian,

I have a similar question, but as Paul said its more related to
Glassfish. Nevertheless if somebody found you what to do in this
situation, I would be interested.

Glassfish v2ur2, Jersey 0.8, elipselink 1.0.2
The reason to use elipselink instead of toplink-essentials was to have
lazy loading working. Weaving of those entity beans seams to work for
me now using JNDI lookup of EntityManager, but as you can follow in the
following thread UserTransaction gets not injected, nor succeed I to
look it up using JNDI ;(

http://bigallan.blogspot.com/2008/10/replacing-toplink-essentials-with.h
tml

Rgds Ben

-----Original Message-----
From: Florian Hars [mailto:hars_at_bik-gmbh.de]
Sent: Donnerstag, 18. Dezember 2008 10:47
To: users_at_jersey.dev.java.net
Subject: [Jersey] Jersey and JPA best practices?


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/Propertie
s"
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.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
For additional commands, e-mail: users-help_at_jersey.dev.java.net