The SpringBeanInvoker's getPersistService() always
returns true (it overwrites ServiceInvoker's default).
I'm not sure why it was done this way but I consider it
a bug because it forces every new request to create an
HttpSession object.
Following Spring Framework's best practices and
examples, most beans (classes) that are exposed as
services to remoting clients are stateless in nature.
Spring's BeanFactory naturally caches all "singleton"
beans it creates so there is no benefit I can see in
attaching a reference to them in every user's session.
At least it should be a configurable behavior or,
better still, dynamically determined depending on
Spring's own config. For example, return false if the
bean is a singleton and true otherwise.
I personally prefer the application to be solely in
control of the session and not the framework, but I'm
open to other approaches. If there is a compelling
argument for keeping the behavior as-is, then maybe a
new NonPersistentSpringBeanInvoker can be created that
overwrites this method.
Perhaps the original writer of this invoker is
available to illuminate the original decision for us.
Logged In: YES
user_id=570853
If it's OK with everyone, here's a patch to remove the method:
Index: SpringBeanInvoker.java
RCS file:
/cvsroot/openamf/openamf/src/java/org/openamf/invoker/SpringBeanInvoker.java,v
retrieving revision 1.1
diff -u -r1.1 SpringBeanInvoker.java
--- SpringBeanInvoker.java 17 Sep 2004 05:01:46 -0000 1.1
+++ SpringBeanInvoker.java 2 Aug 2005 22:25:26 -0000
@@ -121,10 +121,6 @@
return serviceMethod;
}
- public boolean getPersistService() {
- return true;
- }
-
public String getPersistentServiceName() {
return this.getRequest().getServiceName();
}
Logged In: YES
user_id=156581
I committed a fix to CVS.
The fix will be included in OpenAMF 1.0RC12
Logged In: YES
user_id=570853
Thanks Sean. My patch simply removed the method because
SpringBeanInvoker extends ServiceInvoker, which already
returns false. I guess your change is more explicit.