Steve Shucker wrote: > Keep in mind the difference between a flush and a commit in hibernate. > A flush executes all the queued sql against the database without > committing the transaction. Hibernate does this whenever it has > changes that needed to be sent to the database before a query is run. > Otherwise, it defers the flush until just before the commit. Unless > you're using deferred constraints in oracle, constraint violations and > other db-related exceptions will be raised during the flush, not the > commit. > > What I'd really like to do is configure something in hivemind that > would run just before tapestry commits the response. Then I could > call session.flush() there to force the exception before the response > is committed. I just don't know how I can accomplish this.
Ah, ok. Sorry about that, I guess I need to learn to be a bit more precise in my interpretation of the terms. Still, a "session manager" service would allow you to expose a method to flush() in a listener, yes? Or you want to make this more transparent/automatic so you can just redirect to a static error page on any exception without having to explicitly flush()? That still doesn't help for my particular use case though... I need to catch the error and still render a response that might need to access lazily-initialized properties of Hibernate persisted objects... --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]