ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anil <anilk...@gmail.com>
Subject Lock and Transaction
Date Thu, 16 Mar 2017 12:09:35 GMT
Hi,

I need to make sure that entries are added correctly in two caches.

I have two caches  Person and Detail. personId is the key for Person cache
and detailedId is the key for Detail cache.

Each Detail cache entry would have some information of Person cache entry
based on personId. and i am adding entries to caches using Kafka.

When Person and Detail messages are processed, order cannot be maintained
and processed by different nodes. So to avoid data inconsistency issues - i
did following.

*Person message :*

Locl lock = personCache.lock(personId);
lock.lock();

// update person operations for both person cache and detail cache

lock.unlock();

*Detail Mesage :*


Locl lock = detailCache.lock(personId);  // person id from detail message
lock.lock();

// update person operations for both person cache and detail cache

lock.unlock();

with this, till one of the message processed for same person Id, other
would not acquire lock.

now how to maintain the ACID for update operations ? ignite transactions
does not work inside lock. Is there anyway to achieve the above usecase
with ACID ?

Thanks

Mime
View raw message