You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Owens, Stephen (ITD)" <st...@state.ma.us> on 2013/02/13 19:53:25 UTC

PersistentManager Store property problem?

Hi,

I am using apache-tomcat-7.0.26 and am trying to get the PersistentManager with a JDBCStore running.
My context.xml is as follows:
<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->

    <!-- PersistentManager
                The PersistentManager has the capability to swap active (but idle)
                sessions out to a persistent storage mechanism,
                as well as to save all sessions across a normal restart of Tomcat
        -->
        <Manager className="org.apache.catalina.session.PersistentManager"
                distributable="true"
                saveOnRestart="false"
                maxInactiveInterval="-1"
                maxIdleBackup="0"
                processExpiresFrequency="6">
                <Store className="org.apache.catalina.session.JDBCStore"
                        dataSourceName="jdbc/TCMgrSsnDB"
                        checkInterval="3600"
                        sessionTable="TOMCAT_SESSIONS"
                        sessionIdCol="SESSION_ID"
                        sessionValidCol="VALID_SESSION"
                        sessionMaxInactiveCol="MAX_INACTIVE"
                        sessionLastAccessedCol="LAST_ACCESS"
                        sessionAppCol="APP_NAME"
                        sessionDataCol="SESSION_DATA">
                </Store>
        </Manager>

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->

    <!-- Resource Link to host/manager authorization DB in GlobalNamingResources
    -->
    <ResourceLink name="jdbc/TCMgrSsnDB"
        global="jdbc/TCMgrSsnDB"
        type="org.apache.tomcat.jdbc.pool.DataSource"/>

</Context>

I am using log4j and have the loglevel set to DEBUG.
When I checked the logs, I saw this:
catalina.out:2013-02-13 13:42:49,886 [pool-3-thread-1] WARN  org.apache.tomcat.util.digester.Digester  - [SetPropertiesRule]{Context/Manager/Store} Setting property 'checkInterval' to '3600' did not find a matching property.

The Tomcat 7 Documentation at http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html states for the Persistent Manager JDBC Based Store that the checkInterval attribute is the interval (in seconds) between checks for expired sessions among those sessions that are currently swapped out.

Is the checkInterval attribute invalid for a Persistent Manager JDBC Based Store?

Thanks,

Stephen R. Owens
Email: Stephen.Owens@state.ma.us


RE: PersistentManager Store property problem?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Owens, Stephen (ITD) [mailto:stephen.owens@state.ma.us] 
> Subject: PersistentManager Store property problem?

> [SetPropertiesRule]{Context/Manager/Store} Setting property 'checkInterval' 
> to '3600' did not find a matching property.

> The Tomcat 7 Documentation states for the Persistent Manager JDBC Based Store
> that the checkInterval attribute is the interval (in seconds) between checks
> for expired sessions among those sessions that are currently swapped out.

Looks like that entry in the doc is seriously out of date - the field hasn't been in the Tomcat source for a long, long time.  In reality, the timing is based on processExpiresFrequency, which is dependent on the backgroundProcessorDelay setting for container.  By default, the one for <Host> is used, and its setting is 10 (seconds).  Since you have processExpiresFrequency set to 6 (which happens to be the default), the checks are made once per minute.  Set processExpiresFrequency to 360 for once per hour.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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