code: private boolean cleanLockedObjects(ITransaction transaction,
              LockedObject lo, boolean temporary) {
  
          if (lo._children == null) {
              if (lo._owner == null) {
                  if (temporary) {
                      lo.removeTempLockedObject();
                  } else {
                      lo.removeLockedObject();
                  }
  
                  return true;
              } else {
                  return false;
              }
          } else {
              boolean canDelete = true;
              int limit = lo._children.length;
              for (int i = 0; i < limit; i++) {
                  if (!cleanLockedObjects(transaction, lo._children[i], temporary)) {
                      canDelete = false;
                  } else {
  
                      // because the deleting shifts the array
                      i--;
                      limit--;
                  }
              }
              if (canDelete) {
                  if (lo._owner == null) {
                      if (temporary) {
                          lo.removeTempLockedObject();
                      } else {
                          lo.removeLockedObject();
                      }
                      return true;
                  } else {
                      return false;
                  }
              } else {
                  return false;
              }
          }
      }
docs: deletes unused LockedObjects and resets the counter. works recursively
  starting at the given LockedObject
  
  @param transaction
  @param lo
  LockedObject
  @param temporary
  Clean temporary or real locks
  
  @return if cleaned