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 |
} |