'Returns True if there is a lock on the database.'

def check_lock(self):

    lock_info = self._read_lock()
    if (not lock_info):
        return False
    if (os.getpid() == lock_info[u'pid']):
        return False
    return True
