Пример #1
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]);
  }
Пример #2
0
  void addNamedJoinColumnExpression(String name, Expression e) {

    if (namedJoinColumnExpressions == null) {
      namedJoinColumnExpressions = new HashMap();
    }

    namedJoinColumnExpressions.put(name, e);
  }
Пример #3
0
  /**
   * Retruns index for column
   *
   * @param columnName name of column
   * @return int index or -1 if not found
   */
  public int findColumn(String columnName) {

    if (namedJoinColumnExpressions != null && namedJoinColumnExpressions.containsKey(columnName)) {
      return -1;
    }

    if (variables != null) {
      return variables.getIndex(columnName);
    } else if (columnAliases != null) {
      return columnAliases.getIndex(columnName);
    } else {
      return rangeTable.findColumn(columnName);
    }
  }
Пример #4
0
 public JDBCXAResource removeResource(Xid xid) {
   return (JDBCXAResource) resources.remove(xid);
 }
Пример #5
0
 public void addResource(Xid xid, JDBCXAResource xaResource) {
   resources.put(xid, xaResource);
 }
Пример #6
0
 /**
  * This is needed so that XAResource.commit() and XAResource.rollback() may be applied to the
  * right Connection (which is not necessarily that associated with that XAResource object).
  *
  * @see javax.transaction.xa.XAResource#commit(Xid, boolean)
  * @see javax.transaction.xa.XAResource#rollback(Xid)
  */
 JDBCXAResource getResource(Xid xid) {
   return (JDBCXAResource) resources.get(xid);
 }
Пример #7
0
  ExpressionColumn getColumnExpression(String name) {

    return namedJoinColumnExpressions == null
        ? null
        : (ExpressionColumn) namedJoinColumnExpressions.get(name);
  }