The L2 cache should (by default, in any reasonable JPA implementation) not be updated upon commit, but this is not provided for by the JPA2 specification, so you do not understand the implementation features, DataNucleus, of course, only updates it upon commit. If the cache of the second level was updated in a flash, and then these changes to objects bounce back, this leads to the reading of potential invalid / volatile data. Some may allow this as an option.
DataNucleus
source share