[jboss-user] [EJB 3.0] - Re: Stateful bean keep-alive
xmedeko
do-not-reply at jboss.com
Thu May 14 04:43:44 EDT 2009
Hi Peter,
I have JB 5.0.1GA. My SFSB is declared with
@CacheConfig(maxSize = 10000, idleTimeoutSeconds = 60000, removalTimeoutSeconds = 60)
So, the SFSB is removed after 60 seconds of inactivity (for testing). I got the stub (proxy) for this SFSB in a plain old (standalone) Java application (POJA) via JNDI lookup.
When there's more then 60 sec. delay between calls to this bean from the application, then the bean is removed. What's the problem: I want the bean to be removed soon, when the application crashes (i.e. when no addShutdownHook was called), but I do not want to remove it, when the user keep the application open and makes no action. E.g. user goes to lunch or takes a nap.
I was thinking about making a thread in the client application, which will contact the bean in the specified interval (keep-alive calls). But then I have to make sure all calls to the bean are synchronised as well.
So I was thinking, that there must be more people having similar problem. So I am interested, if there's some existing solution in JBoss for this if I have to code it by myself.
Thanks
Andy
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4231006#4231006
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4231006
More information about the jboss-user
mailing list