envp, ret, "Cursor put failed.");
            cursorp-&gt;close(cursorp);
            cursorp = NULL;
            txn-&gt;abort(txn);
            goto err;
        }
    }

    /* 
     * Commit the transaction. Note that the transaction handle
     * can no longer be used.
     */ 
    ret = cursorp-&gt;close(cursorp);
    if (ret != 0) {
        envp-&gt;err(envp, ret, "Cursor close failed.");
        txn-&gt;abort(txn);
        goto err;
    }
    ret = txn-&gt;commit(txn, 0);
    if (ret != 0) {
       