Miguel, On 2/8/24 15:49, Miguel Vidal wrote:
Im trying to configure correctly in 2 different applications : Persistent Manager Implementation using a mysqldb as a datasource.
Do you have both PersistentManager configurations pointing at the same database and same set of tables? I think it will be rare to have session id collisions, but configuring both applications to use the same storage may cause very difficult to discover bugs under high usage.
It will also increase lock contention needlessly across the two applications.
-chris
In one of them that is a legacy project i have some dependencies as <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.framework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.framework.version}</version> </dependency> and it is already doing the registry of the sessions in my bd. but in the other app im using a spring boot with the same configuration. I'm not able to see any registration of the sessions in my db. After the deploy of my app in a tomcat server and hit any resource example /test/resource im able to see the response correctly but i just want to know if this Persistent Manager Implementation is only for legacy apps? or why is running in one and in the other is not. this is my xml for both <?xml version="1.0" encoding="UTF-8"?> <Context antiJARLocking="true" path="/nose" docBase="nose" reloadable="true" useHttpOnly="true" cookies="${uses.cookies}" > <Manager className="org.apache.catalina.session.PersistentManager" maxInactiveInterval="3600" debug="0" saveOnRestart="true" maxActiveSessions="-1" minIdleSwap="1" maxIdleSwap="2" maxIdleBackup="1" > <Store className="org.apache.catalina.session.JDBCStore" dataSourceName="jdbc/tomcat" driverName="com.mysql.jdbc.Driver" sessionAppCol="app_name" sessionDataCol="session_data" sessionIdCol="session_id" sessionLastAccessedCol="last_access" sessionMaxInactiveCol="max_inactive" sessionTable="tomcat_sessions" sessionValidCol="valid_session" /> </Manager> <Resource name="jdbc/tomcat" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" initialSize="${jdbc.pool.initialSize}" maxActive="${jdbc.pool.maxActive}" maxIdle="${jdbc.pool.maxIdle}" minIdle="${jdbc.pool.minIdle}" suspectTimeout="${jdbc.pool.suspectTimeout}" maxWait="${jdbc.pool.maxWait}" timeBetweenEvictionRunsMillis="${jdbc.pool.timeBetweenEvictionRunsMillis}" minEvictableIdleTimeMillis="${jdbc.pool.minEvictableIdleTimeMillis}" validationQuery="select 1" validationInterval="${jdbc.pool.validationInterval}" testOnBorrow="true" removeAbandoned="true" removeAbandonedTimeout="${jdbc.pool.removeAbandonedTimeout}" logAbandoned="true" jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer" testWhileIdle="true" username="${jdbc.username}" password="${jdbc.password}" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://${jdbc.host}:${jdbc.port}/tomcat?autoReconnect=true"/> jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState; org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer; org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer" these 2 are the guides where i learn the mayority how to do it https://svn.apache.org/repos/asf/tomcat/archive/tc4.1.x/trunk/container/catalina/docs/JDBCStore-howto.html https://gerrytan.wordpress.com/2013/08/21/tomcat-7-jdbc-session-persistence/ im going to attach the code that im trying to know why is not working.
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org