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.

link|improve this question
feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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