GemFire does not support using transactions and performing non-transactional operations on the same keys at the same time
All supported versions of Tanzu GemFire
Transactions and non-transactional operations use different concurrency control mechanisms in GemFire. For performance reasons, non-transactional operations do not acquire the exclusive locks that transactions use to check for conflicts. As a result, a transaction cannot detect conflicts caused by non-transactional operations on the same data
Concurrency and Locking:
Risk of Inconsistency:
Mixing transactional and non-transactional operations on the same key can result in updates being applied in different orders on primary and secondary copies. This can leave the data in an inconsistent state across replicas
Example Scenario:
Consider the following sequence of events, which demonstrates how mixing transactional and non-transactional operations on the same key can lead to data inconsistency:
After these operations:
For data consistency, ensure that each key is modified either exclusively by transactions or exclusively by non-transactional operations. Do not mix both operation types on the same key
For further details and design recommendations, see the Design Considerations section of the GemFire documentation
Reference: