ins++;
inserted++;
    public synchronized void commit() throws Exception {        if (killed) {            abort();            return;        }        int ins = 0;        int upd = 0;        int dlt = 0;        int l = nodesArray.size();        Replicator replicator = nmgr.getReplicator();        for (int i = 0; i < l; i++) {            Node node = (Node) nodesArray.get(i);            // update nodes in db            int nstate = node.getState();            if (nstate == Node.NEW) {                nmgr.registerNode(node); // register node with nodemanager cache                nmgr.insertNode(nmgr.db, txn, node);                node.setState(Node.CLEAN);                if (replicator != null) {                    replicator.addNewNode(node);                }                ins++;                nmgr.app.logEvent("inserted: Node " + node.getPrototype() + "/" +                                  node.getID());            } else if (nstate == Node.MODIFIED) {                nmgr.updateNode(nmgr.db, txn, node);                node.setState(Node.CLEAN);                if (replicator != null) {                    replicator.addModifiedNode(node);                }                upd++;                nmgr.app.logEvent("updated: Node " + node.getPrototype() + "/" +                                  node.getID());            } else if (nstate == Node.DELETED) {                // nmgr.app.logEvent ("deleted: "+node.getFullName ()+" ("+node.getName ()+")");                nmgr.deleteNode(nmgr.db, txn, node);                nmgr.evictNode(node);                if (replicator != null) {                    replicator.addDeletedNode(node);                }                dlt++;            } else {                // nmgr.app.logEvent ("noop: "+node.getFullName ());            }            node.clearWriteLock();        }        nodes.clear();        nodesArray.clear();        cleannodes.clear();        if (nmgr.idgen.dirty) {            nmgr.db.saveIDGenerator(txn, nmgr.idgen);            nmgr.idgen.dirty = false;        }        if (active) {            active = false;            nmgr.db.commitTransaction(txn);            txn = null;        }        nmgr.app.logAccess(tname + " " + l + " marked, " + ins + " inserted, " + upd +                           " updated, " + dlt + " deleted in " +                           (System.currentTimeMillis() - tstart) + " millis");    }