Hibernate version: 3.1rc2
I'm trying to use the HibernateFilterLong found in CaveatEmptor last release and the version from:
http://hibernate.bluemars.net/43.html?cmd=prntdoc
that it is slightly different from CaveatEmptor version. In hibernate.cfg.xml I have set
hibernate.current_session_context_class to
ExtendedSessionContext
class (
not to thread or jta).
I get this exception (please read the filter code from above link):
Quote:
org.hibernate.HibernateException: setFlushMode is not valid without active transaction
in this line of code:
Code:
// Always disable flushing for Long Session pattern
log.debug("Disabling automatic flushing of the current Session");
sf.getCurrentSession().setFlushMode(FlushMode.NEVER);
If a comment the setFlushMode line, I get this new exception:
Quote:
javax.servlet.ServletException: Transaction not successfully started
at line:
Code:
log.debug("Trying to rollback database transaction after exception");
sf.getCurrentSession().getTransaction().rollback();
So, where I must benig the transaction?
Its not automatic with getCurrentSession() ?
Why It has been manually used sf.getCurrentSession().setFlushMode(FlushMode.NEVER) although the
ExtendedSessionContext class already do it?
Thanks for suggest.
Gianni
Florence (ITALY)