Transaction txn = Transaction.startTransaction(false);
try
{
db.insert("key 1", "value 1");
db.insert("key 2", "value 2");
txn.commit();
txn = Transaction.startTransaction(true);
assertEquals(2, db.size());
assertEquals("value 2", db.get("key 2"));
assertEquals("value 1", db.get("key 1"));