@Override
    public boolean removeLockByResource(String resource) {
        ResourceLock thisLock = locksOfR.get(resource);

        // There is no lock on this resources
        if (thisLock == null)
            return false;

        locksOfR.remove(resource);

        if (!thisLock.isValid(resource))
            return false;

        // no lock on the resource
        if (thisLock.getType() == null)
            return false;

        for (String transaction : thisLock.getTransactions())
            this.resourcesOfT.get(transaction).remove(resource);
        thisLock.clear();
        return true;
    }