Details
-
Improvement
-
Status: Patch Available
-
Major
-
Resolution: Unresolved
-
None
-
None
-
Forbid a non-transactional IgniteCache#clear() inside a transaction
-
Docs Required, Release Notes Required
Description
`IgniteCache#clear` invocation are not transactional.
But, currently, Ignite allow to invoke `clear` inside transaction.
This lead to unexpected behavior and hides business logic errors.
We must disallow IgniteCache#clear call inside transaction.
/** */ @Test public void testClearInTransction() { IgniteCache<Object, Object> cache = client.createCache(new CacheConfiguration<>("my-cache").setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)); cache.put(1, 1); try (Transaction tx = client.transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.READ_COMMITTED)) { cache.put(2, 2); cache.clear(); tx.commit(); } assertFalse(cache.containsKey(1)); assertTrue(cache.containsKey(2)); }
Attachments
Issue Links
- is cloned by
-
IGNITE-23121 Disallow IgniteCache#iterator inside transaction
- Open
- relates to
-
IGNITE-8801 Change default behaviour of atomic operations inside transactions
- Resolved
-
IGNITE-2313 Need to add a mode to fail atomic operations within a transaction
- Resolved
-
IGNITE-20579 Finally restrict atomic operations inside the transaction (remove the system property)
- Resolved