### Question:
Transaction extends NativeObject implements Closeable { public void commit() { if (self != 0) { checkErrorCode(env, mdbx_txn_commit(self)); self = 0; } } Transaction(Env env, long self); long getId(); void renew(); void commit(); void reset(); void abort(); @Override void close();  }### Answer:
@Test public void testCommit() { try (Transaction tx = env.createWriteTransaction()) { db.put(tx, data, data); tx.commit(); } assertArrayEquals(data, db.get(data)); try (Transaction tx = env.createWriteTransaction()) { db.delete(tx, data); tx.commit(); } assertNull(db.get(data)); }