Search in sources :

Example 1 with LongKeyHashMap

use of org.hsqldb_voltpatches.lib.LongKeyHashMap in project voltdb by VoltDB.

the class SessionData method getDataResultHead.

Result getDataResultHead(Result command, Result result, boolean isNetwork) {
    int fetchSize = command.getFetchSize();
    result.setResultId(session.actionTimestamp);
    if (command.rsConcurrency == ResultConstants.CONCUR_READ_ONLY) {
        result.setDataResultConcurrency(ResultConstants.CONCUR_READ_ONLY);
        result.setDataResultHoldability(command.rsHoldability);
    } else {
        if (result.rsConcurrency == ResultConstants.CONCUR_READ_ONLY) {
            result.setDataResultHoldability(command.rsHoldability);
        // add warning for concurrency conflict
        } else {
            if (session.isAutoCommit()) {
                result.setDataResultConcurrency(ResultConstants.CONCUR_READ_ONLY);
                result.setDataResultHoldability(ResultConstants.HOLD_CURSORS_OVER_COMMIT);
            } else {
                result.setDataResultHoldability(ResultConstants.CLOSE_CURSORS_AT_COMMIT);
            }
        }
    }
    result.setDataResultScrollability(command.rsScrollability);
    boolean hold = false;
    boolean copy = false;
    if (result.rsConcurrency == ResultConstants.CONCUR_UPDATABLE) {
        hold = true;
    }
    if (isNetwork) {
        if (fetchSize != 0 && result.getNavigator().getSize() > fetchSize) {
            copy = true;
            hold = true;
        }
    } else {
        if (!result.getNavigator().isMemory()) {
            hold = true;
        }
    }
    if (hold) {
        if (resultMap == null) {
            resultMap = new LongKeyHashMap();
        }
        resultMap.put(result.getResultId(), result);
    }
    if (copy) {
        result = Result.newDataHeadResult(session, result, 0, fetchSize);
    }
    return result;
}
Also used : LongKeyHashMap(org.hsqldb_voltpatches.lib.LongKeyHashMap)

Aggregations

LongKeyHashMap (org.hsqldb_voltpatches.lib.LongKeyHashMap)1