Thank you. I've implemented the non IoC version of it, which I found to be
almost the same as in
http://struts.apache.org/2.0.9/docs/non-ioc-version-of-opensessioninviewinterceptor.html
http://struts.apache.org/2.0.9/docs/non-ioc-version-of-opensessioninviewinterceptor.html
 

Antonio Petrelli-3 wrote:
> 
> 2007/8/31, wild_oscar <[EMAIL PROTECTED]>:
>>
>> I am making my first web app and I found out today I was doing something
>> wrong:
>>
>> I was building a SessionFactory on my HibernateEntityManager:
>>
>> _sessionFactory = configuration.buildSessionFactory();
>>
>> This EntityManager is called on the action so, basically, I was creating
>> a
>> SessionFactory on each request.
>>
>> Searching the web, I panicked! Most people talk about using Spring in
>> addition to Struts2 + Hibernate.
>>
>> Having just started on Struts2, and not having even completed my first
>> web
>> app, I feel I will lose another week just to understand the basics of
>> Spring
>> to understand what is needed.
>>
>> My question is: what is the most appropriate way of binding the
>> SessionFactory to the web application? Can someone pinpoint the basics
>> and/or a tutorial where I can learn this? And how/when is the
>> sessionfactory
>> closed in the web application?
> 
> The "Open session in view" pattern can help you:
> http://www.hibernate.org/43.html
> If you are using Spring, there is a ready-made filter:
> http://www.springframework.org/docs/api/org/springframework/orm/hibernate/support/OpenSessionInViewFilter.html
> 
> Antonio
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Where-to-put-hibernate%27s-SessionFactory--tf4361648.html#a12512623
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to