DataContainer dataContainer,
PersistenceManager persistenceManager,
VersionGenerator versionGenerator,
TxInvocationContext context,
KeySpecificLogic ksl, TimeService timeService) {
EntryVersionsMap uv = new EntryVersionsMap();
for (WriteCommand c : prepareCommand.getModifications()) {
for (Object k : c.getAffectedKeys()) {
if (ksl.performCheckOnKey(k)) {
ClusteredRepeatableReadEntry entry = (ClusteredRepeatableReadEntry) context.lookupEntry(k);
if (entry.performWriteSkewCheck(dataContainer, persistenceManager, context,
prepareCommand.getVersionsSeen().get(k), versionGenerator, timeService)) {
IncrementableEntryVersion newVersion = entry.isCreated()
? versionGenerator.generateNew()
: versionGenerator.increment((IncrementableEntryVersion) entry.getMetadata().version());
uv.put(k, newVersion);
} else {
// Write skew check detected!
throw new WriteSkewException("Write skew detected on key " + k + " for transaction " +
context.getTransaction(), k);
}