[opencms-dev] Re: Spring / Hibernate: OpenSessionInViewFilter
Georg Raffer
georg.nc at gmail.com
Mon Mar 6 10:47:22 CET 2006
hi,
we are using the
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter with
singleSession.
It works fine. If you use lazy="true" (which is default), you have to
fetch the associations once if you want to use the object in the next
request (e.g. putting into session). Loading in a java class, forwarding
to a jsp in the same request (and than using lazy associations) should
be no problem with this filter.
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
</init-param>
</filter>
bye,
Georg
Jonathan Woods wrote:
> When you say 'don't seem to be applicable', do you mean there's something
> stopping you from adding a Tomcat filter? I haven't tried it with OpenCms,
> but I think you should still be able to do something like this through
> Tomcat config alone.
>
> Jono
>
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Stephen Callaghan
> Sent: 03 March 2006 05:23
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] Spring / Hibernate
>
> We've been using Spring successfully for our own java classes which we are
> loading into OpenCMS as a module. However, we are now getting the
> LazyInstantiationException from Hibernate when talking to our database. All
> the usual fixes for this (OpenSessionInViewFilter etc) dont seem to be
> applicable for OpenCMS.
>
> Has anyone else solved this problem?
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list To change your
> list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
More information about the opencms-dev
mailing list