| Coming back to this question of CacheTransactionContext, its scope within a Session (one per Session versus one per txn-boundary)... I initially just simply ported this code as-is from 6.0 where I had not yet converted to use one CTC per Session. That approach led to many very subtle problems with timestamps. With that in mind, unless I hear differently, I plan to:
- convert this to use the one CTC per Session approach. When the Session starts it will generate the CTC it will then use during its entire lifecycle.
- rename CTC -> CacheTransactionSynchronization per Galder's preference (since we have heard no others)
- wire up the transaction callbacks to the CacheTransactionSynchronization
- with these changes, Session's CacheTransactionSynchronization will ever be null. we will delegate SharedSessionContractImplementor#getCurrentCacheTransactionContext (after renaming) to it's CacheTransactionSynchronization's CacheTransactionSynchronization#getCurrentTransactionStartTimestamp
Let me know if this does not work for anyone, and why... |