struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hezjing <hezj...@gmail.com>
Subject Configuring OpenSessionInViewInterceptor as S2's interceptor
Date Wed, 22 Aug 2007 08:39:14 GMT
Hi

I'm encountering this exception (when trying to iterate a list of
orders for a specific customer in JSP),

failed to lazily initialize a collection of role:
com.dummy.Customer.orders, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:249)
at org.apache.struts2.util.MakeIterator.convert(MakeIterator.java:81)
......

I'm using Struts 2, Hibernate and Spring (for creating actions, DAOs and etc).

I read that Spring's OpenSessionInViewInterceptor will resolve this
problem but can you describe how to configure
OpenSessionInViewInterceptor in Struts2?

And, is there a better alternative than using OpenSessionInViewInterceptor?



-- 

Hez

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message