The ClassCastException fixed.  I had the valve configured incorreclty in
the server.xml.

Would still appreciate feedback on the approach discussed below.

Thanks,

Gary

-----Original Message-----
From: Gary Blomquist [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 16, 2006 2:12 PM
To: Tomcat Developers List
Subject: Extending PersistentValve ?

I would like to be able to use round robin loading balancing with a
JDBCStore.  However, it appears that using the PersistentManager with
JDBC store could cause the sessions to be stale when a session migrates
between workers due to the asyncronous behavior of the
PersistentManager.  (I realize their is a SimpleTcpCluster available as
a clusterering solution but I can not use because it relies on
multicast.)
 
Viewing the source it appears that the PersistentValve with the
PersistentManager  and JDBCStore could be a solution.   It appears that
it would load a session from the store at the begging of each request
and save it back to the store at the end of the request.  I would like
to modify the behavior to only load/save when the session is dirty based
on the last_access timestamps.  
 
Any comments on the solution? ( I realize their is some performance
penalty due to object serialization and writing blobs to the database;
however, in our case I think this would not be prohibitive esp. if there
is a small amount of data in the session.)
 
Also,  when I attempt to run Tomcat with the PersistentValve I get the
following exception:
 
SEVERE: An exception or error occurred in the container during the
request processing
java.lang.ClassCastException: org.apache.catalina.core.StandardEngine
        at
org.apache.catalina.valves.PersistentValve.invoke(PersistentValve.java:9
9)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
48)
        at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
        at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
        at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:744)
        at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:
674)
        at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.
java:866)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:684)
        at java.lang.Thread.run(Thread.java:595)
 
Note:  (I have not yet made mods to the PersistentValue)
 
 
Thanks for your assistance,
 
Gary Blomquist  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to