I'm using the 'Extending a Session for a conversation' model (section 11.2.3 of the Hibernate book), implemented using Spring Web Flow
flow-managed persistence.
The Spring implementation of this uses sessions with FlushMode.MANUAL, and performs all changes accumulated in the Persistence Context in a single transaction, at the end of the conversation.
I'm thinking about using an extra-lazy collection, but looking at AbstractPersistentCollection.readSize(), for extra-lazy collections Session.flush() is run regardless of the flush mode.
This then seems to break the 'extended conversation' model, making me think that I can't use extra-lazy collections.
I understand the motivation for flushing the session prior to querying the DB, but in other places where queries are to be performed, the configured FlushMode is respected.
So:
- Am I interpreting this correctly, and is my concern valid?
- Could this call to Session.flush() irrespective of the configured FlushMode be considered a bug?
Thanks!
Aron