Em Mon, 25 May 2009 12:43:17 -0300, Antonio Fernández
<amiguel.fernan...@gmail.com> escreveu:
Hi again,
Hi!
* org.hibernate.HibernateException: No CurrentSessionContext
configured!
The suggested way is to override getSession() to return something other
than sessionFactory.getSession() or set a CurrentSessionContext in you
SessionFactory (recommended). This section in the Hibernate documentation
tells you why and how:
http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#architecture-current-session.
A few changes in BaseHibernateDAO :
- Replaced the import of class org.hibernate.classic.Session with
org.hibernate.Session.
Thanks for pointing me that. I've just fixed this in the Generic
DAO-Hibernate branch. By the way, in the Maven repository, there is an
improved 1.1 version there.
- Add the org.hibernate.Session object as a new paremeter in all the
constructor methods.
- Changes in class BaseHibernateDAO :
Add new field of type org.hibernate.Session, that will be
initialized inside the constructor ( like the SessionFactory does )
Modify the method getSession(), returning the new field
reference
These modifications aren't appropriate to *Generic* DAO-Hibernate, as they
wouldn't work without Tapestry-IoC (for example, when you're building a
desktop application or using Spring), and this package is meant to be
independetly from Tapestry-IoC.
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org