@Transactional public void transactionalPutWithException(String key, String value) { transactionalTaskContext.getMap("testMap").put(key, value); throw new RuntimeException(); }
@Transactional public void transactionalPut(String key, String value) { transactionalTaskContext.getMap("testMap").put(key, value); }
@Override public Object execute(TransactionalTaskContext txContext) throws TransactionException { TransactionalMap<Integer, Long> map = txContext.getMap(mapName); Long current = map.getForUpdate(key); Long update = current + increment; map.put(key, update); return null; } });
@Override public Object execute(TransactionalTaskContext context) throws TransactionException { TransactionalMap<String, String> map = context.getMap("map"); map.put("1", "1"); map.put("2", "2"); return null; } });
@Override public Object execute(TransactionalTaskContext transactionalTaskContext) { TransactionalMap<Integer, Integer> txMap = transactionalTaskContext.getMap(map.getName()); txMap.get(key); return null; } });
@Override public Object execute(TransactionalTaskContext transactionalTaskContext) { TransactionalMap<Integer, Integer> txMap = transactionalTaskContext.getMap(map.getName()); if (useSet) { txMap.set(key, value); } else { txMap.put(key, value); } return null; } });
@Override public Object execute(TransactionalTaskContext txContext) { TransactionalMap<Integer, Long> txMap = txContext.getMap(name); Long value; if (getForUpdate) { value = txMap.getForUpdate(key); } else { value = txMap.get(key); } txMap.put(key, value + increment); return null; } });