David E Jones wrote: > On Mar 22, 2010, at 3:03 PM, Adam Heath wrote: > >> Marc Morin wrote: >>> We have also notice that the cache can get polluted with contents from a >>> rolledback transaction!! Also, the visibility of the objects doesn't >>> respect the transaction boundaries.... >>> >>> This has caused some problems, we haven't fixed it yet.... so no patch to >>> contribute... sorry. >> Code that modifies entities should not be calling caching variants of >> the delegator. > > It shouldn't even be able to... entities from the cache should be set to > read-only (they used to be anyway).
It's not that said code is trying to modify entities that are already in the cache. It's that some entity is modified, then this supposed code calls a caching variant, so the newly created value gets stored in the cache. To make it more succinct, code that modifies database values can not *ever* call a delegator caching variant. Actually, how about if we modify the delegator to see if a transaction is active for the current thread, and throw an exception if a cache store is attempted?
