I am trying to test the distributed transaction support using following
piece of code. While debugging the code I observed that code executes on
client node first and after doing commit the code executes on a node which
owns that kay.

What I am trying to do is, to collocate the data to avoid the network call
as my data in real use case is going to big. But while debugging the code,
I observed that entry processor first executes on client node, gets all the
data executes the task. and after commit executes the same code on remote

Can someone please explain this behavior? My use case to execute the task
on nodes which owns the data in single transaction.

private static void executeEntryProcessorTransaction(IgniteCache<Long,
Person> cache) {
    Person val=null;
    try (Transaction tx =
  long myid =6l;
        CacheEntryProcessor entryProcessor = new MyEntryProcessor();
        cache.invoke(myid, entryProcessor);
        System.out.println("Overwrote old value: " + val);
        val = cache.get(myid);
        System.out.println("Read value: " + val);

        System.out.println("Read value after commit: " +   cache.get(myid));


Reply via email to