I have OpenSessionInViewFilter configured for Spring in my web.xml file, but
I'm still getting lazy init errors in Wicket. Note, I'm not passing objects
around, just pulling them and using them. I don't think I need a detachable
model in this case. In any case, I would not want to have to wrap every
object suspected of being part of a Hibernate session.

        <filter>
                <filter-name>openSessionInViewFilter</filter-name>
        
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
        </filter>
        <filter-mapping>
                <filter-name>openSessionInViewFilter</filter-name>
                <url-pattern>/app/*</url-pattern>
        </filter-mapping>


Here is (essentially) the wicket page:

public class Page extends WicketPage {
  @SpringBean
  private Dao dao;

  public Page() {
    List<Dog> dogs = dao.getDogs();
    for (Dog dog : dogs) {
      System.out.println(dog.getFleas().size());  //Lazy init error...
    }
  }
}

What could I be missing?
-- 
View this message in context: 
http://www.nabble.com/Hibernate-LazyInitializationException-on-first-call-tf3867163.html#a10955977
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to