protected synchronized void checkWriteLock() {
synchronized void checkWriteLock() {
    protected synchronized void checkWriteLock() {        // System.err.println ("registering writelock for "+this.getName ()+" ("+lock+") to "+Thread.currentThread ());        if (state == TRANSIENT) {            return; // no need to lock transient node        }        Transactor current = (Transactor) Thread.currentThread();        if (!current.isActive()) {            throw new helma.framework.TimeoutException();        }        if (state == INVALID) {            nmgr.logEvent("Got Invalid Node: " + this);            Thread.dumpStack();            throw new ConcurrencyException("Node " + this +                                           " was invalidated by another thread.");        }        if ((lock != null) && (lock != current) && lock.isAlive() && lock.isActive()) {            nmgr.logEvent("Concurrency conflict for " + this + ", lock held by " + lock);            throw new ConcurrencyException("Tried to modify " + this +                                           " from two threads at the same time.");        }        current.visitNode(this);        lock = current;    }