Smart!

I assume its the JMS system holding a reference to the Helper thats
preventing the helper from being garbage collected when the bean is
passiavated...

\Jon

> I would do something like this instead:
> * In the session bean you should indeed register a helper class with
> JMS, and the helper class should hold a reference to the session bean
> (get it in the session bean by doing ctx.getEJBObject()).
> * On onMessage your helper class should call the session bean, and
> preferably not the same method as did the register above. You can
> provide the message on the call
> * Your session bean may now process the message
>
> i.e. in SessionBean:
> public void listen()
> {
>   Helper h = new Helper(ctx.getEJBObject());
>   <register h with JMS somehow>
> }
>
> public void doStuff(Message m)
> {
>   // Process the JMS message
> }
>
> and in Helper:
> ..
> MySession theBean;
> public Helper(MySession ms)
> {
>   theBean = ms;
> }
>
> public void onMessage(Message m)
> {
>   theBean.doStuff(m);
> }
> -----------

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to