code: public boolean writeLock(TransactionImpl tx, Object obj)
      {
          LockEntry writer = getWriter(obj);
          if (writer == null)
          {
              if (setWriter(tx, obj))
                  return true;
              else
                  return writeLock(tx, obj);
          }
          if (writer.isOwnedBy(tx))
          {
              return true;    // If I'm the writer, then I can write.
          }
          return false;
      }
docs: acquire a write lock on Object obj for Transaction tx.
  @param tx the transaction requesting the lock
  @param obj the Object to be locked
  @return true if successful, else false