Hi Ian, thanx a lot for your reply. Yes, HibernateInterceptor looks very promising. I just read somewhere that there are some issues around AOP and cxf, but maybe those were related to an older version. Are you using thisi approach rigth now in your apps?
Also, as you seem to be knowledgeable about Hibernate / Spring: can I still use HibernateTemplate the same way? I would assume that HibernateTemplate in this case picks up the Session opened by the Interceptor? Cheers Sven --- Sven Haiges Y! Messenger / Skype: hansamann ----- Original Message ---- From: Ian Roberts <[EMAIL PROTECTED]> To: [email protected] Sent: Friday, July 18, 2008 3:48:13 AM Subject: Re: Hibernate Session during CXF call Sven Haiges wrote: > What I actually need is something like the Spring > OpenSessionInViewInterceptor just for CXF calls. A new Hibenrate > session should be opened with each incoming call ot a service method > and closed after completion. > > Is this available fro CXF? If not, would it be diffcult to implement? Spring's HibernateInterceptor should do what you're after: <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate.HibernateInterceptor"> <property name="sessionFactory" ref="..." /> </bean> <bean id="realServiceImpl" class="my.service.Impl"> ... </bean> <bean id="serviceImpl" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="target"><ref local="realServiceImpl"/></property> <property name="interceptorNames"> <list> <idref local="hibernateInterceptor" /> </list> </property> </bean> <jaxws:endpoint implementor="#serviceImpl" implementorClass="my.service.Impl" ... /> Ian -- Ian Roberts | Department of Computer Science [EMAIL PROTECTED] | University of Sheffield, UK
