5.3. Transactions
For this tutorial, start two instances of the GUI. Repeat the exercises in the previous tutorial, only starting transactions before creating/removing nodes or adding/removing data. This will depict how replication only occurs on transaction boundaries. Try rolling back a few transactions as well, to see how nothing gets replicated in these cases. Below is the sample code for managing transactions:
tm = cache.getTransactionManager(); tm.begin(); // do operations here tm.commit(); // or tm.rollback();