tag:blogger.com,1999:blog-2330120457456880954.post4832906264487017443..comments2023-11-02T22:17:12.318+11:00Comments on DevGrok: Reacquiring a Stateful Session Bean on NoSuchEJBExceptionChris Wattshttp://www.blogger.com/profile/12923587712192007751noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-2330120457456880954.post-13754225855634634512011-03-25T01:05:34.901+11:002011-03-25T01:05:34.901+11:00Hi. I am using JBoss 5.1.0 and I have Stateful Se...Hi. I am using JBoss 5.1.0 and I have Stateful Session Beans that are destroyed but I do not want the user to get an exception. I would like for the bean to be recreated when this occurs. How would I go about writing the ProxyProvider and how to bind it to my bean? Thanks.Unknownhttps://www.blogger.com/profile/03773455675914011634noreply@blogger.comtag:blogger.com,1999:blog-2330120457456880954.post-46414663711750057142009-09-19T22:18:53.542+10:002009-09-19T22:18:53.542+10:00True, that could easily be changed to reacquire th...True, that could easily be changed to reacquire the bean within the proxy on NoSuchEJBException.<br /><br />However in my case I wanted the exception cascaded up to the caller so special logic can be performed, as it was used to store the user's session state. Thus if it is lost then the user has been logged out.<br />In my case the calling code doesn't need to reacquire the bean, the next call on the bean will automatically get a new one.Chris Wattshttps://www.blogger.com/profile/12923587712192007751noreply@blogger.comtag:blogger.com,1999:blog-2330120457456880954.post-11662920673929454612009-08-29T06:51:46.916+10:002009-08-29T06:51:46.916+10:00Correct me if I'm wrong, but that example does...Correct me if I'm wrong, but that example doesn't silently retrieve a new session bean, right? If the old session bean is gone, it throws the exception back to the caller, and only fetches a new session bean the next time a method is called, right? So you'd still need retry code in your callers.<br /><br />You could try to fetch a new session bean in the invoke method, or recurse with a retry limit or something.reganhttps://www.blogger.com/profile/04290248770162065260noreply@blogger.com