public boolean upgradeLock(LockEntry reader)
    {
        checkTimedOutLocks();

        String oidString = reader.getOidString();
        ObjectLocks objectLocks = null;
        synchronized (locktable)
        {
	        objectLocks = (ObjectLocks) locktable.get(oidString);
        }

        if (objectLocks == null)
        {
            return false;
        }
        else
        {
            // add writer entry
            LockEntry writer = new LockEntry(reader.getOidString(),
                    reader.getTransactionId(),
                    System.currentTimeMillis(),
                    reader.getIsolationLevel(),
                    LockEntry.LOCK_WRITE);
            objectLocks.setWriter(writer);
            // remove reader entry
            objectLocks.getReaders().remove(reader.getTransactionId());
            return true;
        }
    }
public boolean upgradeLock ( LockEntry reader ) { checkTimedOutLocks ( ) ; String oidString = reader . getOidString ( ) ; ObjectLocks objectLocks = null ; synchronized ( locktable ) { objectLocks = ( ObjectLocks ) locktable . get ( oidString ) ; } if ( objectLocks == null ) { return false ; } else { LockEntry writer = new LockEntry ( reader . getOidString ( ) , reader . getTransactionId ( ) , System . currentTimeMillis ( ) , reader . getIsolationLevel ( ) , LockEntry . LOCK_WRITE ) ; objectLocks . setWriter ( writer ) ; objectLocks . getReaders ( ) . remove ( reader . getTransactionId ( ) ) ; return true ; } }
upgrade a reader lock entry for transaction tx on object obj
and write it to the persistent storage.