Hi all,
I have two tomcats with same web applicattion running on two machines. They have Persistent sessions by Postgresql Database.
When I initialize two tomcats and i load page all goes okey. Apache redirects request to tomcat1 or tomcat2. Problems come in this case:
- Initialize two tomcats with its owns hibernate Sessions.
- Web Access to Apache. It redirects requests to, for example, tomcat1.
- Session is inserted into database tomcat_sessions table with hibernate session object thanks to session in view implementation.
- Stopped Tomcat1 before session expires (forced by me).
- In same web session try to do something, for viewing that tomcat2 take control of that session and continues request from that session but...
ERROR!!!
Code:
25-feb-2006 19:19:23 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:12009
25-feb-2006 19:19:23 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/129 config=null
25-feb-2006 19:19:24 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
25-feb-2006 19:19:24 org.apache.catalina.startup.Catalina start
INFO: Server startup in 11647 ms
25-feb-2006 19:21:14 org.apache.catalina.cluster.tcp.SimpleTcpCluster memberDisappeared
INFO: Received member disappeared:org.apache.catalina.cluster.mcast.McastMember[tcp://28.100.0.100:4001,catalina,28.100.0.100,4001, alive=343198]
[ WARN] {25/02/06 19:21:24} (hibernate.impl.SessionFactoryObjectFactory.getInstance()) - Not found: 9ce480e409a270a80109a270aca30000
[ WARN] {25/02/06 19:21:25} (hibernate.impl.SessionFactoryObjectFactory.getInstance()) - Not found: 9ce480e409a270a80109a270aca30000
I think this is because when you stop tomcat1 and tomcat2 tries to get SessionFactory, its session factory hasn't this id. I was thinking about binding SessionFactory to JNDI in order to have same names to each one tomcat but... Context is read-only in tomcat.
Any ideas?
Best regards