I just read this blog:
http://blog.hibernate.org/cgi-bin/blosx ... batch.html
Gavin, you mention the use of hibernate.jdbc.batch_size, but this does nothing for OutOfMemoryException resulting from Session-level caching of persistent objects. One still has to invoke Session.clear() manually.
Why doesn't Hibernate store the Session cache using WeakReferences so they are freed as needed and keep strong references to the cache entries referenced by the last "hibernate.jdbc.batch_size" commands?
Wouldn't this be the best of both worlds and everyone will be happy?
Gili