code: public synchronized void close(boolean suspend) throws RepositoryException {
          if (mState == SUSPENDED) {
              // If suspended, attempting to close again will likely deadlock.
              return;
          }
  
          if (suspend) {
              for (TransactionScope<?> scope : mAllScopes.keySet()) {
                  // Lock scope but don't release it. This prevents other threads
                  // from beginning work during shutdown, which will likely fail
                  // along the way.
                  scope.getLock().lock();
              }
          }
  
          mState = suspend ? SUSPENDED : CLOSED;
  
          for (TransactionScope<?> scope : mAllScopes.keySet()) {
              scope.close();
          }
  
          mAllScopes.clear();
          mLocalScope.remove();
      }
docs: Closes all transaction scopes. Should be called only when repository is
  closed.
  
  @param suspend when true, indefinitely suspend all threads interacting
  with transactions