code: public <T> T executeWithUser(final String user, final String password,
                                   final SpecificUserAction<T> userAction) {
          Preconditions.checkState(!transactionManager.isTransactionActive(),
                  "User can't be changed during transaction");
          Preconditions.checkState(specificUser.get() == null,
                  "Specific user already defined as '%s'",
                  specificUser.get() != null ? specificUser.get().user : null);
          specificUser.set(create(user, password));
          logger.trace("Use specific user: {}", user);
          T result = null;
          try {
              result = userAction.execute();
          } catch (Throwable th) {
              Throwables.throwIfUnchecked(th);
              throw new UserActionException(String.format("Failed to perform operation under user '%s'", user), th);
          } finally {
              specificUser.remove();
          }
          return result;
      }
docs: Changes connection credentials user outside of transaction. Used to affect multiple transactions.
  <p>
  Recursive user changes are not allowed, but user change inside transaction is allowed with
  {@link #executeWithTxUser(String, SpecificUserAction)}.
  <p>
  Action approach is important to explicitly define scope of specific user and
  properly cleanup state (which may be not done in case of direct override).
  <p>
  Propagates runtime exceptions (orient exceptions).
  <p>
  IMPORTANT: connection pool will not be used for specific user! Instead explicit new connection would
  be opened.
  
  @param user       specific user name
  @param password   specific user password
  @param userAction logic to execute with specific user
  @param <T>        type of returned result (may be Void)
  @return action result (may be null)