You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Lawrence, Gabriel" <gl...@ucsd.edu> on 2003/06/13 01:18:09 UTC

In memory session replication and session listeners?

I'm using the tomcat 4 clustering stuff found at:

http://cvs.apache.org/~fhanik/index.html

And I have one issue. I have a service that tracks some information that
is reported outside the users session. This is examined by a different
client then the users client. I want to keep this global information in
sync across my loadbalanced servers, as I can't necessarily predict
which server the this different client is going to hit. 

The way it works without clustering is that I have a session listener
set up that gets notified whenever data is added to a users session.
This then triggers a update to my global store as well. What I think I'm
seeing is that when session information is replicated to my other
server, the fact that something was set isn't triggering a session
listener call on the other server. Does that mesh with peoples
understanding? 

Is there a way I can get it to?

Thanks!
-gabe

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


RE: In memory session replication and session listeners?

Posted by Filip Hanik <ma...@filip.net>.
The session listener is only notified on the machine the value actually gets
set.
Session data doesn't get replicated using the setAttribute/removeAttribute
methods, but pure serialization.

And for now, the clustering doesn't have a public API to send your own data
through it.
one way you an do it, is to implement the java.io.Externilizable interface,
and when the data gets
deserialized, then set the stuff in your global variable, just remember to
only set it once.

do you see where I am going with this?

Filip

> -----Original Message-----
> From: Lawrence, Gabriel [mailto:glawrence@ucsd.edu]
> Sent: Thursday, June 12, 2003 4:18 PM
> To: Tomcat Users List
> Subject: In memory session replication and session listeners?
>
>
> I'm using the tomcat 4 clustering stuff found at:
>
> http://cvs.apache.org/~fhanik/index.html
>
> And I have one issue. I have a service that tracks some information that
> is reported outside the users session. This is examined by a different
> client then the users client. I want to keep this global information in
> sync across my loadbalanced servers, as I can't necessarily predict
> which server the this different client is going to hit.
>
> The way it works without clustering is that I have a session listener
> set up that gets notified whenever data is added to a users session.
> This then triggers a update to my global store as well. What I think I'm
> seeing is that when session information is replicated to my other
> server, the fact that something was set isn't triggering a session
> listener call on the other server. Does that mesh with peoples
> understanding?
>
> Is there a way I can get it to?
>
> Thanks!
> -gabe
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>


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