JDBCRealm, jakarta DBCP and mysql timeout

Cesare Zavattari <[email protected]> Mon, 11 Jul 2005 17:02:25 +0200
Newsgroups gmane.comp.java.securityfilter.user
Message-ID <[email protected]>
Hi All,
I regolarly use securityfilter for my webapps and I find it very useful 
and very simple to setup.
I use the CatalinaReamAdapter using the jakarta common-dbcp, wrapping 
the mysql connector.
The problem is that after 8 hours of inactivity the connection is broken 
(timeout) and the user has to authenticate himself twice (evidently the 
first failed connection restores the connection).

The problem seems to exist with securityfilter only, because if I cut 
the filter section from my web.xml the database timeout problem seems to 
disappear, I mean, the db connections used by the webapp work without 
timeout problem.

here's my realm definition in securityfilter-config.xml:

<realm className="org.securityfilter.realm.catalina.CatalinaRealmAdapter" />
    <realm className="org.apache.catalina.realm.JDBCRealm">
         <realm-param name="driverName" 
value="org.apache.commons.dbcp.PoolingDriver"/>
         <realm-param name="debug" value="99"/>
         <realm-param name="connectionURL" 
value="jdbc:apache:commons:dbcp:/db"/>
         <realm-param name="connectionName" value="xxx"/>
         <realm-param name="connectionPassword" value="xxx"/>
         <realm-param name="userTable" value="tcusers"/>
         <realm-param name="userNameCol" value="user_name"/>
         <realm-param name="userCredCol" value="user_pwd"/>
         <realm-param name="userRoleTable" value="tcroles"/>
         <realm-param name="roleNameCol" value="role_name"/>
    </realm>

Any ideas?
Thank you in advance!

-- 
Cesare


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar