Okay, here's what I would try:
Use the Session Facade Pattern.
Create a stateless session bean and inject the EntityManagerFactory into it using the code
you have in your servlet class (cut and paste it). Get a reference to this bean in your
servlet using JNDI lookup:
InitialContext ctx = new InitialContext();
| FacadeBeanLocal bean = ctx.lookup("FacadeBean/local");
| bean.doWhatever();
The lookup string will vary depending on your packaging.
Using and EAR: "<ear-name>/<bean-name>/[local | remote]"
Using a JAR: "<bean-name>/[local | remote]"
Make sure you label the interface your facade bean implements with either @Local or
@Remote.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046541#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...