function commitTransaction(elem, fcn)
    txn = elem.beginTransaction();
    fcn();
    txn.commit();
end