[jboss-user] [EJB 3.0] - Re: Stateful bean keep-alive
xmedeko
do-not-reply at jboss.com
Mon May 18 02:55:52 EDT 2009
Hello Peter,
thanks for your reply.
"PeterJ" wrote : Don't set removalTimeoutSeconds, use idleTimeoutSeconds instead. ...
unfortunately, our session bean cannot be serialized from various reasons. I am moving an existing, a little bit larger, application into JBoss. It would be not easy to make it serializable. (Maybe in the future I will have to do it anyway.)
"PeterJ" wrote : Creating a new client thread might work, but you have to be careful. First, the thread must not lookup the EJB itself - you will end up with a new EJB, not with the one that you want to keep alive. Therefore, you must pass the bean's proxy to the thread. Second, I recommend creating a separate method on the EJB that does nothing - the primary purpose of this method is for the extra thread to occasionally call it. This should guarantee that the state of the bean does not change inadvertently.
Yes, that what I have already done :-)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4231519#4231519
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4231519
More information about the jboss-user
mailing list