Would you recommend using a wicket RequestCycleListener to implement the OSIV pattern and storing the hibernate session in a threadlocal ? WOudl there be a way for me to make the hibernate session stored in this ThreadLocal to be available in regular servlets (my app is currently a mix of wicket pages and legacy servlets ? The problem I am encountering is that in the legacy servlets, if I try MyRequestCycleListener.getSession(), the #onEndRequest has already been executed and the session in the ThreadLocal has already been closed.
For the legacy servlets should I use a regular servlet filter ?
Any comments ? tips ?
In MyRequestCycle, I do use the ManagedSessionContext to bind/unbind the hibernate Session: