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?

Thank you!
-- 
View this message in context: 
http://www.nabble.com/-S2--Where-to-put-hibernate%27s-SessionFactory--tf4361648.html#a12431558
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