Hi,

Consider the following transaction where we read key 1 twice.

try (Transaction tx = Ignition.ignite().transactions().txStart(PESSIMISTIC,
READ_COMMITTED)) {
cache.get(1);
//...
cache.get(1);
tx.commit();
}

According to the documentation here,
https://apacheignite.readme.io/docs/transactions, data is read without a
lock and is never cached. If that is the case, then how do we avoid a dirty
read on the second cache.get(1)? Another uncommitted transaction may update
the key between the first and second reads.

In most RDMS, a READ_COMMITTED isolation level, acquires locks for both
read and writes. The read lock is released after a read while the write
lock is held until the transaction completes. So for the above example, I
expect a read lock on each cache.get(1).


Thanks,

Reply via email to