You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Johanes Soetanto <ot...@gmail.com> on 2014/06/19 07:14:14 UTC

Tomcat 6 JDBCStore session keep being reset

Hi all,

We are having problem debugging our implementation of JDBCStore session
persistence. We followed guide from this post
http://www.intelligrape.com/blog/2010/07/21/tomcat-6-session-persistence-through-jdbcstore/
and it works in our local machine and our test servers. When we move it on
our production server, our sessions got resetted randomly.

We have been trying to find out what went wrong without success.

All our setup are using
- Tomcat 6.0.39 using APR connector on port 8443 (SSL) and 8080
- Oracle Java 1.7.0_60-b19
- MySQL connector 5.1.21
- Application server timeout is set to 30min
- Application is running using Spring Framework and Spring Security
- Test and Production servers running on Linode with private ip to
communicate between servers
- We have Zabbix monitoring all our production and test server by pinging
the app every minute (not sure how this can relate to the issue)


Content of our conf/context.xml for the app servers is similar like below,
while our standalone solr servers do not have the persistent manager set
up.
<Context useHttpOnly="true">
    <Resource name="jdbc/db" auth="Container" type="javax.sql.DataSource"
              driverClassName="com.mysql.jdbc.Driver"
              username="XXXX" password="XXXX" defaultAutoCommit="false"
              initialSize="4" maxActive="30" minIdle="4" maxIdle="4"
maxWait="10000"
              removeAbandoned="true" removeAbandonedTimeout="300"
              validationQuery="SELECT 1" testOnBorrow="true"
              url="jdbc:mysql://XXX.XXX.XXX.XXX:3306/app"/>

    <Manager className='org.apache.catalina.session.PersistentManager'
         saveOnRestart='true' minIdleSwap='0' maxIdleSwap='1'
maxIdleBackup='1'>
        <Store className="org.apache.catalina.session.JDBCStore"
driverName="com.mysql.jdbc.Driver"

 connectionURL="jdbc:mysql://XXX.XXX.XXX.XXX:3306/tomcat?user=tomcat&amp;password=XXXX"
               sessionTable="session"
               sessionIdCol="session_id"
               sessionDataCol="session_data"
               sessionValidCol="valid_session"
               sessionMaxInactiveCol="max_inactive"
               sessionLastAccessedCol="last_access"
               sessionAppCol='app_name' />
    </Manager>
</Context>


Production Environment
- 1 db server (64bit)
- 1 app server (32bit) connected to db server
- 2 app servers (64bit) connected to db server
- 2 solr servers (64bit) connected to db server

Test Environment (all 64bit)
- 1 app+solr+db server (combined)
- 1 app+solr server connected to db server

Is there some advice on how to debug our issues? or is there some obvious
configuration issue that we have? Thanks for all the advice beforehand.



Johanes

Re: Tomcat 6 JDBCStore session keep being reset

Posted by Mark Thomas <ma...@apache.org>.
On 19/06/2014 06:14, Johanes Soetanto wrote:

> Is there some advice on how to debug our issues? or is there some obvious
> configuration issue that we have? Thanks for all the advice beforehand.

Check the system clocks on your production machines.

Add a session listener to log the stakctrace when a session is destroyed.

Add session ID to the access logs and review them for unexpectedly
closed sessions.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org