Tomcat 8, 8.5, or 9
Is there a session manager for Tomcat that does not keep sessions in memory at 
all but stores the session attributes in a database?

Example:  If I create a session for the first time then the session manager 
would create a session ID and write it to a database table.  Now if you do 
setAttribute on the session it would then insert a row in the database based on 
the session ID and name of the attribute.  It would not delay.  It would write 
it at that moment.  If you do a getAttribute it would then select the value 
from the database based on the session ID and name.  At no time is a session 
object kept in memory by the session manager.

The other element is that if I have N number of tomcat instances that run 
behind a load balancer any one of them can receive an incoming request.  There 
is no communication that has to occur between tomcat instances.

I looked over the Tomcat JDBCStore.  But it looks like it still maintains 
sessions in memory for a time before writing them.  I would like an 
implementation that never keeps them in memory.  Direct writing and direct 
reading when a session does a setAttribute or getAttribute.

Is this even possible to do?  My feeling is that the Manager might have some 
fields that never do anything.  I don't want to create something that someone 
else has already done.

If this is able to be done and it has not been developed before I would be 
happy to do it if someone wants to give me some basic starting information on 
how to do this.  I would be happy to share it with the community.

Thanks,

Lance

Reply via email to