de.zib.scalaris.examples
public class TransactionReadWriteExample extends Object
read and write methods of
the Transaction class together in one transaction.| Constructor and Description |
|---|
TransactionReadWriteExample() |
public static void main(String[] args)
(key1, value1) = ("key1", "value1"),
(key2, value2) = ("key2", "value2") and key3 = "key3" are
used.
write(key1, value1);
write(key2, value2);
result1 = read(key1);
result2 = read(key2);
result3 = read(key3);
write(key3, result1 + result2);
result3 = read(key3);
commit();
write(key1, value1);
commit();
write(key1, "WRONG value");
read(key1);
abort();
read(key1);
commit();
args - command line arguments with the structure "key1 value1 key2
value2 key3"Transaction1(String, String, String, String, String),
Transaction2(String, String, String, String, String)