E - generic type of the managed entity.
Typically implementing PersistenceEntity.public interface FeatureForceIncrementModificationCounter<E>
forceIncrementModificationCounter(Object).| Modifier and Type | Method and Description |
|---|---|
void |
forceIncrementModificationCounter(E entity)
Enforces to increment the
modificationCounter e.g. |
void forceIncrementModificationCounter(E entity)
modificationCounter e.g. to enforce that a parent object gets locked when its children are modified.Order and its contained
OrderPosition. By default the users can modify an Order and each of its OrderPositions in
parallel without getting a locking conflict. This can be desired. However, it can also be a demand that an
Order gets approved and the user doing that is responsible for the total price as the sum of the prices of
each OrderPosition. Now if another user is adding or changing an OrderPostion belonging to that
Order in parallel the Order will get approved but the approved total price will differ from what
the user has actually seen when he clicked on approve. To prevent this the use-case to modify an
OrderPosition can use this method to trigger a locking on the associated Order. The implication is
also that two users changing an OrderPosition associated with the same Order in parallel will get a
conflict.entity - that is getting checked.Copyright © 2014–2019 devon4j-Team. All rights reserved.