"No object in the L2 cache is "dirty" since there are no actual objects there ..."
=> Yes I checked that out up-front. You're right doing this, that's probably the only correct L2 cache implementation. (another good reason to choose DN)
"How your object is created/initialised from the L2 cached object is where something is made dirty"
Ok I get it. It's due to a PostLoad cleaning number (floating point errors when it's loaded from the db). I didn't identified correctly the dirty field...
Deactivating the L2 cache is clearly a bad "solution".
Bad, there are some matter of discussion ;-) This subject may requires some thinking (eviction strategy, application load, cache size, deployment, datamodel complexity, concurrency, ...) before considering a broad usage... I faced some crazy applications around the world with another JDO product years ago. For some customers or part of their applications, at the end we preferred to have an efficient graph loading to the L2 cache, and for others it was the opposite...
But I agree, having a L2Cache is really important. For a part of the applications I'm working on actually, sure L2Cache will be an amazing performance improvement.
Thanks,
--
Stephane