Are you using OpenSessionInViewFilter (spring/hibernate)?

The default flushmode is set to NEVER, so you need to override org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
@Override

protected Session getSession(SessionFactory sessionFactory) throws DataAccessResourceFailureException {

Session session = super.getSession(sessionFactory);

session.setFlushMode(FlushMode.AUTO);

return session;

}

@Override

protected void closeSession(Session session, SessionFactory sessionFactory) {

session.flush();

super.closeSession(session, sessionFactory);

}

----- Original Message ----- From: "Mark" <[EMAIL PROTECTED]>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Wednesday, May 24, 2006 1:58 PM
Subject: Re: Hibernate persisted data never makes it to DB


By the way - I am right to assume that what I experience here is not normal Hibernate behaviour?

MARK



Lutz Hühnken wrote:
my two cents, in three parts...

- about the problem:
well, usually, it kind of works. This may sound silly, but do you
maybe have hbm2ddl.auto set to "create-drop" ? Or when you check if
something has been stored, are you sure you're checking the right
database? I'm not making fun of you, I have seen these things happen,
to very smart people. One more: are you using the HibernateTemplate
from the right package (there is a hibernate and a hibernate3 package.
Actually, I don't know what happens if you use the wrong one, might
even work).

Anyhow, if nothing is stored and yet you don't get any error message,
I guess you have to recheck your configuration carefully.

- about the log file location
if you just give the filename, it will be created in the current
working directory. If you start Tomcat from the command line, that
will be $CATALINA_HOME/bin. If you start it using the Eclipse plugin,
the location is, well, eclipsed - I have not managed to find it yet.
Anyhow, both variants are not very desirable, so you might consider
providing an absolute path to your logfile (as in
/var/log/hibernate.log). Personally, on my development machine, I just
log to stdout.

- about the "wanting to know the internals":
don't get me wrong, no offense intended, and it's really none of my
business, I just can't keep the thought to myself: I think it is a
very valid standpoint, but I also think it is slightly contradictory
in your case. You claim you want to know internals, but yet you use
the Spring HibernateTemplate? Isn't that all about hiding a lot of
internals?

hth,
Lutz

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






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



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

Reply via email to