Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm experimenting with tomcat JDBCStore-based session persistence and wonder whether there is a way to make tomcat store sessions in DB as soon as possible?

I've tried to play with minIdleSwap and maxIdleSwap values, but I guess I just don't understand what actually those parameters are standing for, though I've read the documentation.

share|improve this question

I think you need the maxIdleBackup setting. From the linked javadoc:

Sets the option to back sessions up to the Store after they are used in a request. Sessions remain available in memory after being backed up, so they are not passivated as they are when swapped out. The value set indicates how old a session may get (since its last use) before it must be backed up: -1 means sessions are not backed up.

Note that this is not a hard limit: sessions are checked against this age limit periodically according to processExpiresFrequency. This value should be considered to indicate when a session is ripe for backing up.

So it is possible that a session may be idle for maxIdleBackup + processExpiresFrequency * engine.backgroundProcessorDelay seconds, plus the time it takes to handle other session expiration, swapping, etc. tasks.

share|improve this answer
nope, this setting is just ignored, at least when I'm trying to set it to -1. – shabunc Nov 21 '11 at 21:50
@shabunc Look again. '-1 means sessions are not backed up'. That's not what you asked about. – EJP Mar 23 '14 at 23:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.