hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hensley, Richard" <Richard.Hens...@McKesson.com>
Subject RE: HiveMind filter timing question
Date Fri, 12 Nov 2004 00:04:20 GMT
You know, about 5 minutes ago I did exactly that. I'm not seeing what that
does to the application.

I made the servlet filter deal with my global object instead of the other
way around. I think it fixes all my problems.

-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Thursday, November 11, 2004 3:52 PM
To: hivemind-user@jakarta.apache.org
Subject: RE: HiveMind filter timing question


Well, what I would do is write my own filter which does essentially what the
HiveMindFilter does (I'd even use the same request attribute key).  The only
difference would be that the filter would not shutdown the registry when
it's being destroyed.  One easy way to do that would be to extend
HiveMindFilter and override the destroy() method as a no-op.  The only issue
is when to shutdown the registry.  Or, does the registry necessarily need to
be shutdown at all.  If the webapp is being reloaded, the classes (and
therefore all static variables, like singletons) will be reloaded too.  What
do you think? 

-----Original Message-----
From: Hensley, Richard [mailto:Richard.Hensley@McKesson.com] 
Sent: Thursday, November 11, 2004 5:30 PM
To: 'hivemind-user@jakarta.apache.org'
Subject: RE: HiveMind filter timing question

Unfortunately, we required access to our registry outside of the
request/response cycle because everything depends on Hivemind services. In
our case, our backend service don't even know they are running inside of a
web container and have no servlet dependencies. 

So, to answer your question we have a singleton class called Global that
returns references to our services using a HiveMind registry. At the moment,
our web application initializes the Global object using the HiveMind filter
when the application initializes. We use Tapestry, so the exact location is
in the engine.createGlobal() method.

This need for a global singleton occurred because we have objects that are
created outside of HiveMind require HiveMind services, and have no servlet
dependencies. Our initial take at constructing these objects was to pass the
service references into the constructors of the objects. This failed in two
ways. 

1. It got very ugly very fast
2. When an object was serialized and deserialized, the service references

I think the core to the problem is that we can't create the objects using
Hivemind, so we have to fall back to old techniques. At this point in time
we are choose reach out and get the services needed.

When I made the global singleton, it seemed hokey, but I could not come up
with a better way...

Richard

-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Thursday, November 11, 2004 2:00 PM
To: hivemind-user@jakarta.apache.org
Subject: RE: HiveMind filter timing question


Yes, it makes sense.  How are you obtaining the reference to the Registry
outside of the normal request/response cycle?  Does an object inside your
session have a reference to the serialization/deserialization service
object?

-----Original Message-----
From: Hensley, Richard [mailto:Richard.Hensley@McKesson.com] 
Sent: Thursday, November 11, 2004 4:48 PM
To: 'hivemind-user@jakarta.apache.org'
Subject: RE: HiveMind filter timing question

After puzzling around with, I think the timing is this:

1. User enters "catalina.sh stop"
2. tomcat starts it shutdown process by gracefully stopping all the web
applications 
3. tomcat then serializes all the sessions for the web applications

The problem is that when the web application shuts down, the HiveMind filter
is also shutdown, which shuts the registry down. 

The serialization process tries to get a service from the registry, which
throws a registry shutdown exception.

Does this make any sense?

I'm also trying to figure out the timing for the startup sequence, but
haven't nailed it yet. I will report back when I know more.

Richard

-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Thursday, November 11, 2004 1:23 PM
To: hivemind-user@jakarta.apache.org
Subject: RE: HiveMind filter timing question


What exactly are you trying to do?  When exactly are you trying to use the
serialization/deserialization service which is managed by HiveMind?  

-----Original Message-----
From: Hensley, Richard [mailto:Richard.Hensley@McKesson.com] 
Sent: Thursday, November 11, 2004 1:42 PM
To: 'hivemind-user@jakarta.apache.org'
Subject: HiveMind filter timing question

We are using the hivemind filter in our application. One of the HiveMind
services is used for interaction with the database. This service is used
during serialization and deserialization of database persistent objects. We
are using Tomcat which will serialize and deserialize sessions during a
normal restart. What we have discovered is that HiveMind is not available
because the filter has been shutdown by the time that Tomcat serializes the
session. We still don't know, but we suspect, that HiveMind won't be
available by the time that Tomcat deserializes the sessions.

Does anybody have any suggestions?

Our only thought was to use a different filter that is not responsible for
building the registry, but is responsible for thread clean up stuff. This
suffers from application reload issues, which are currently handled by the
filter.

Help!!!

Richard


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



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


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



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


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



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


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


Mime
View raw message