I found some problems when I tried to use ignite transactions.
I expected that the transaction would commit alfter tx.commit();
but when I debugged my code step by step , changes had been already in effect
before tx.commit();??
I also tried reading some source code of ignite transactions, but found no
answer??
I guess I must make a stupid mistake.
Here is my code.
public static void withTransaction(Execute execute) throws Exception {
try (Transaction tx = Ignition.ignite().transactions().txStart()) {
execute.call();
tx.commit();
}
}
public void call() throws Exception {
Area area = new Area();
area.cityId = 1l;
area.name = "test";
??
cache.put(entity.id, entity);
??
}