users@glassfish.java.net

Hwo to use Jpa on servlet

From: <glassfish_at_javadesktop.org>
Date: Tue, 08 Jun 2010 20:20:56 PDT

I am new in jpa , I try some Jpa example on java application, but when I walk on step more try to test jpa on servlet , I get the problem on create an EntityManagerFactory , It looks like I can't use the some way that I create EntityManagerFactory method like the follow

 [b]EntityManagerFactory emf=Persistence.createEntityManagerFactory("MyJPAApplicationPU");
        EntityManager em=emf.createEntityManager();
        try{
            EntityTransaction entr=em.getTransaction();[/b]
 I Google, and find some Thread-safe issuer , any not ideal how to use jpa in servlet .
any help is appreciate !
[Message sent by forum member 'newnet']

http://forums.java.net/jive/thread.jspa?messageID=473466