View | Details | Raw Unified | Return to bug 34319
Collapse All | Expand All

(-)StoreBase.java (-2 / +11 lines)
Line 169 Link Here
169
     * By default oldKeys() returns all keys but should be overridden,
170
     * for efficiency, to provide a list of keys for sessions that are
171
     * likely ready to be expired.
172
     */
173
    protected String[] oldKeys() throws IOException {
174
        return keys();
175
    }
176
177
    /**
Line 183 Link Here
183
            keys = keys();
192
            keys = oldKeys();
184
--
Line 190 Link Here
199
(-)JDBCStore.java (-9 / +38 lines)
Line 442 Link Here
442
    public String[] keys() throws IOException {
442
    public String[] keys() throws IOException
443
--
443
    {
444
        return keys(false);
445
    }
446
447
    /**
448
     * Return an array containing the session identifiers of all Sessions
449
     * currently saved in this Store that are older than dirt.
450
     * If there are no such Sessions, a zero-length array is returned.
451
     *
452
     * @exception IOException if an input/output error occurred
453
     */
454
    protected String[] oldKeys() throws IOException {
455
        return keys(true);
456
    }
457
    
458
459
    /**
460
     * Return all keys or just old keys depending on the 'old' argument.
461
     *
462
     * @exception IOException if an input/output error occurred
463
     */
464
    protected String[] keys(boolean old) throws IOException {
Lines 454-459 Link Here
454
                    if (preparedKeysSql == null) {
476
                    String keysSql = "SELECT " + sessionIdCol + " FROM "
455
                        String keysSql = "SELECT " + sessionIdCol + " FROM "
477
                        + sessionTable + " WHERE " + sessionAppCol
456
                                + sessionTable + " WHERE " + sessionAppCol
478
                        + " = ?";
457
                                + " = ?";
479
                    if (old) {
458
                        preparedKeysSql = _conn.prepareStatement(keysSql);
480
                        // old sessions are those where the current time is
459
					}
481
                        // greater than the last access time plus max inactive time
460
--
482
                        keysSql += " AND ? > (" +
483
                            sessionLastAccessedCol + " + (" + sessionMaxInactiveCol +
484
                            "*1000))";
485
                    }
486
487
                    preparedKeysSql = _conn.prepareStatement(keysSql);
Line 462 Link Here
490
                    if (old) {
491
                        preparedKeysSql.setLong(2, System.currentTimeMillis());
492
                    }

Return to bug 34319