If present, OptimisticLockingAwareGridDialect should be leveraged to implement the ALL/DIRTY column value based optimistic locking scheme. Currently, this uses the "emulated" optimistic locking scheme only.
One problem with that approach in particular for MongoDB is that since we no longer store null columns, we have no way to compare them or compare their absence. That's a bit concerning and we might force a user to chose between DIRTY/ALL optimistic locking and not storing nulls.
So after a careful analysis, there is one case where I am a bit concerned about when not storing null values. AssociationRow.getColumnNames() and Tuple.getColumnNames() would return a subset of columns (only the non null ones).
Investigating now the consequences, it seems there are two problematic cases. In case of query project we have a problem see but we identified this problem already.
The second problem is that when we will implement DIRTY / ALL optimistic locking, we won't consider columns rendered null in the process. That is more concerning.
The null columns is issue
looks more a 4.2 or 4.x feature. Any complain?