Short story:
I think I found a wicket or databinder bug.

I'm getting an error when rehydrating a databinder page from the
DiskPageStore. I am posting it on both the wicket mailing list and the
databinder forum, because I'm not sure which it belongs to.

Long story:

Let me give the error and the (abbreviated) stack trace, and explain what I
found from debugging:

ERROR [2009-01-19 15:09:02,040] RequestCycle.logRuntimeException():1435 - No
session currently bound to execution context
org.hibernate.HibernateException: No session currently bound to execution
context
        at
org.hibernate.context.ManagedSessionContext.currentSession(ManagedSessionContext.java:50)
        at
org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:544)
        at
net.databinder.DataStaticService.getHibernateSession(DataStaticService.java:77)
        at
net.databinder.models.HibernateObjectModel.load(HibernateObjectModel.java:264)
        at
net.databinder.models.LoadableWritableModel.getObject(LoadableWritableModel.java:53)
        at
com.csc.aims.wicket.models.AbstractObjectModel.getObject(AbstractObjectModel.java:57)
        at
com.csc.aims.wicket.models.AbstractObjectModel.getObject(AbstractObjectModel.java:1)
        at
net.databinder.models.HibernateObjectModel.hashCode(HibernateObjectModel.java:353)
        at java.util.HashMap.hash(HashMap.java:264)
        at java.util.HashMap.putForCreate(HashMap.java:407)
        at java.util.HashMap.readObject(HashMap.java:1014)
        at sun.reflect.GeneratedMethodAccessor215.invoke(Unknown Source)
...
        at
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228)
        at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:706)
        at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:311)
        at org.apache.wicket.Session.getPage(Session.java:751)
        at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:448)
        at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1229)
...

The gist is that deserializing the page causes HOM's hashCode() to be
called, which loads the model object. This happens during the RESOLVE_TARGET
step of request cycle processing, before the response target and page
information are set! Databinder's
DataConversationRequestCycle.dataSessionRequested(Object) is not able to get
the page, because the page is still being loaded. It returns from
DataConversationRequestCycle ln. 82 without ever calling
openHibernateSession. The HOM then tries to load using the existing session
and fails.

In my particular scenario, I am triggering two ajax events, then submitting
the page before they finish. The first ajax event complets, then the submit
- then the error is thrown by the second ajax event, before it gets to the
process and respond step.

Our wicket version is 1.3 snapshot revision 694703 (close to 1.3.5?) with
minor patches. We are using databinder 1.1.2.

-- 
View this message in context: 
http://www.nabble.com/wicket-databinder-bug--No-session-currently-bound...-tp21551210p21551210.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to