Hi.

I'm trying to get Spring's OpenSessionInFilterView to work but i'm not very lucky.

We've got OSIV working in our JSF/MyFaces/Facelets/Spring app.

I do :

1. Put in my web.xml :

[skip]

Looks fine.

2. My Application Context :

[...] looks fine.

3. I Have a static class use to retrieve the hibernate's session but it's not in the application context :

I 've tried various methods :

ApplicationContext ctx = FacesContextUtils.getWebApplicationContext(FacesContext.getCurrentInstance());
sessionFactory = (SessionFactory) ctx.getBean("sessionFactory");
return sessionFactory.getCurrentSession();

return SessionFactoryUtils.getSession(getSessionFactory(),true);

But nothing is working ...

I'd suggest using Hibernate through Spring's HibernateDaoSupport, not accessing session factory/sessions directly.

Your setup looks fine. What exactly isn't working? Have you tried downtracing? Is the session set in a thread-local var in your filter? Do session factory/utils access this var?

Bye.
/lexi

Reply via email to