Hibernate version: 1.2.0.GA
I noticed in the API documentation for IInterceptor, it says
Quote:
The Session may not be invoked from a callback
(nor may a callback cause a collection or proxy to be lazily initialized).
Is this really the case for all of the IInterceptor methods? In particular, I don't see why the restriction should be true for PreFlush() and PostFlush(), since those methods take the collection of all entities in the session cache as an argument. If you can't touch the passed entities (any type of access, after all, could cause lazy loading) then why are they passed at all?
In any case, in PreFlush() we call out to business logic that does all kinds of access and modification to the entities being flushed (we have our own determination for which are dirty), and so far we haven't encountered any problems. It's much cleaner to perform pre-flush logic on dirty entities through PreFlush() since you have the real entities and apparently can do whatever data access you want, rather than in the abysmal FlushDirty(), where you get horrid parallel arrays of property names and values, and you can't do any data access with the session ...
Can someone clarify this?