Hi Ramu,

the problem is the "fetchType" attribute on your relationship. It defaults to 
"FetchType.LAZY", which means that the other side of the relation is not loaded 
until required. If the entity gets detached and the relationship field is not 
loaded, you will get this exception on client side.

To work around you could
a) set the fetchType to "FetchType.EAGER" (not recommended for ManyToMany)
b) explicitely force loading the relationship field BEFORE the entity gets 
detached (before the session bean method is left). 
To do so: call e.g. "student.getCourses().size();" after loading a student.
Calling only "student.getCourses();" does not help, you have to access the 
collection content to make it load.

Hope this helps

Wolfgang

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192700
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to