On Fri, Jan 03, 2003 at 03:10:21PM +1100, Gavin King wrote: > For Hibernate 2, should we add one or both of: > > Session.evict(foo); //remove foo from the Session-level cache > Session.refresh(foo); //reload foo's state from the database > > There *would* be some exotic cases (like this one) where they could > be useful....
I brought this up in the forums yesterday, due to my session cache filling up as the result of large queries. Gavin also suggested Session.clear(). evict would work fine for me, but it would end up something like this: for (Iterator it = query.iterate(); it.hasNext();) { Cat cat = (Cat)it.next(); session.evict(cat); // do some calculation on cat } Maybe it's silly to pull it into the cache via next(), just to evict as the very next step. So, how about query.setTransient(true)? All objects returned by the query would be transient and not take up space in the cache. -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