Hi,
  I work on ignite 2.7.0

  I have a value type as below

public class Entity {
     String id;
     String value;
     Date date;
}

then interact with cache as below

try (Transaction tx =
     ignite.transactions().txStart(TransactionConcurrency.PESSIMISTIC,
TransactionIsolation.SERIALIZABLE)) {
     cache1.invoke("k6", new EntryProcessor<String, Entity, Object>() {
     @Override     public Object process(MutableEntry<String, Entity>
mutableEntry, Object... objects) throws EntryProcessorException {
     Entity e = mutableEntry.getValue();
    e.setId("hello3");
    e.setValue("v3");
    mutableEntry.setValue(e);
    return null;
}
});
    tx.commit();
}

But entry value does not change after commit.

If i code as below, entry value would change after commit.

try (Transaction tx =
     ignite.transactions().txStart(TransactionConcurrency.PESSIMISTIC,
TransactionIsolation.SERIALIZABLE)) {
     cache1.invoke("k6", new EntryProcessor<String, Entity, Object>() {
     @Override     public Object process(MutableEntry<String, Entity>
mutableEntry, Object... objects) throws EntryProcessorException {
    mutableEntry.setValue(new Entity("test2", "a2", new Date()));
    return null;
}
});
    tx.commit();
}

I found that changes to entry would not take effect after commit when
mutableEntry.getValue() called.

Reply via email to