Opening a TransactionMap requires that a transaction is started first:

MVStore s = new MVStore.Builder().fileName("map.dat").open();
ts = new TransactionStore(s);
ts.init();
Transaction tx = ts.begin();
TransactionMap<Integer, String> map = tx.openMap("map");

The call ts.begin() returns a Transaction that is used to open the 
TransactionMap.
Below, next either commit or rollback is called for the started transaction:
tx.rollback();  //or tx.commit();

After rollback, for example, the TransactionMap is still open but is it 
still allowed to use it for reading?
At least, the below loop can successfully read committed entries from the 
TransactionMap.
//Iterate in key order
Integer firstKey = map.firstKey();
for (Iterator<Integer> iterator = map.keyIterator(firstKey, false); 
iterator.hasNext();) {
  Integer key = iterator.next();
  String value= map.get(key);
  System.out.println("key=" + key + " value=" + value);
}

Or more generally, what operations are allowed for an open TransactionMap 
for which
commit or rollback is already called?

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to