Don't treat exceptions as recoverable This is more of a necessary practice than a "best" practice. When an exception occurs, roll back the Transaction and close the Session. If you don't, Hibernate can't guarantee that in-memory state accurately represents persistent state.
I think it would be helpful if Hibernate could guarantee in-memory state at least for particular types of failures. In particular, Session.load seems useful (and feasible?). What is driving this request is a need for a simple way to test if many rows already exist in a table. It is prohibitive to have to reopen a new session every time Session.load fails. I imagine the tricky bit is that the different JDBC drivers throw different types of exceptions? But perhaps the hibernate adapters could abstract out those differences, for the important types of errors. -Chris ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel