Appfuse2 + struts2 + hibernate
I'm trying to display a list of related objects for the first time and
receiving the dreaded LazyInitializationException.
org.hibernate.LazyInitializationException: failed to lazily initialize a
collection of role: com.getrolling.cis.model.Region.tours, no session or
session was closed
I've uncommented the lazyLoadingFilter in web.xml but I'm still getting this
darn exception when trying to access a list in the UI. I also tried to load
the list by accessing it in my action before the object is displayed. The
list gets loaded fine in my Dao and action tests.
In the Region object:
/**
* @return the tours
*/
@OneToMany(mappedBy="region")
@OrderBy("city,trail")
public List<Tour> getTours() {
return tours;
}
In the Tour object:
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinColumn(name = "region")
public Region getRegion() {
return region;
}
--
View this message in context:
http://www.nabble.com/LazyInitializationException-again-tf4654121s2369.html#a13297291
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]