Пример #1
0
  public synchronized Session[] getAllSessions() {

    Session[] sessions = new Session[sessionMap.size()];
    Iterator it = sessionMap.values().iterator();

    for (int i = 0; it.hasNext(); i++) {
      sessions[i] = (Session) it.next();
    }

    return sessions;
  }
Пример #2
0
  public synchronized void resetLoggedSchemas() {

    Iterator it = sessionMap.values().iterator();

    for (int i = 0; it.hasNext(); i++) {
      Session session = (Session) it.next();

      session.resetSchema();
    }

    sysLobSession.resetSchema();
  }
Пример #3
0
  public synchronized void removeSchemaReference(Schema schema) {

    Iterator it = sessionMap.values().iterator();

    for (int i = 0; it.hasNext(); i++) {
      Session session = (Session) it.next();

      if (session.currentSchema == schema.name) {
        session.resetSchema();
      }
    }
  }
Пример #4
0
  public synchronized boolean isUserActive(String userName) {

    Iterator it = sessionMap.values().iterator();

    for (int i = 0; it.hasNext(); i++) {
      Session session = (Session) it.next();

      if (userName.equals(session.getGrantee().getNameString())) {
        return true;
      }
    }

    return false;
  }
Пример #5
0
  /**
   * Return the list of transactions currently <I>in prepared or heuristically completed states</I>.
   * Need to find out what non-prepared states they are considering <I>heuristically completed</I>.
   *
   * @see javax.transaction.xa.XAResource#recover(int)
   */
  Xid[] getPreparedXids() {

    Iterator it = resources.keySet().iterator();
    Xid curXid;
    HashSet preparedSet = new HashSet();

    while (it.hasNext()) {
      curXid = (Xid) it.next();

      if (((JDBCXAResource) resources.get(curXid)).state == JDBCXAResource.XA_STATE_PREPARED) {
        preparedSet.add(curXid);
      }
    }

    return (Xid[]) preparedSet.toArray(new Xid[0]);
  }