/*
* We get the value from the grid and compare the version values before putting the next version in
* Contrary to the database version, there is
* TODO should we use cache.replace() it seems more expensive to pass the resultset around "just" the atomicity of the operation
*/
final EntityKey key = EntityKeyBuilder.fromPersister( this, id, session );
final Tuple resultset = gridDialect.getTuple( key, getTupleContext() );
checkVersionAndRaiseSOSE( id, currentVersion, session, resultset );
gridVersionType.nullSafeSet( resultset, nextVersion, new String[] { getVersionColumnName() }, session );
gridDialect.insertOrUpdateTuple( key, resultset, getTupleContext() );
return nextVersion;