[jboss-user] [EJB 3.0] - EntityManager / Lazy Fetch / J2EE / Swing App

knifegun do-not-reply at jboss.com
Mon Dec 11 17:29:44 EST 2006


I have a J2EE based application running on JBoss 4.0.5 EJB 3.  I have a Swing client which uses a stateless session bean to retrieve data from the database via an Entity Manager. All the EJBs are set to LAZY fetch.  When I try to access a child entry to a EJB (i.e. access the object representing the a row in another table), I get an error because the session is closed.

Now I know this is because the EJB is detached since the EntityManger was loaded in the J2EE container and serialized to my Java Swing client.  

My question is, are there any recommended ways to still use LAZY fetching but be able to access children of a current entity bean?  Any utility to reattach the EJB?  Any best practice?


Thanks!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992921#3992921

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992921



More information about the jboss-user mailing list