tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Sébastien Scrève <>
Subject Re: How to remove stateful sessions programmatically ?
Date Wed, 22 Oct 2008 11:11:08 GMT

Ok thanks for the tip David.

What I try to implement is "conversation" between Tapestry and OpenEJB. This
"conversation" concept is already implemented into Seam.

I store the stateful instance into a web session and I'd like to remove the
instance as soon as the session expires.

That's why I thought that an API that would allow us to remove stateful
could be helpful.
I know it already exists in OpenEJB but a standard API to parse deployment
information outside sessions beans could also be a nice thing.

What do you think ?


Jean-Sébastien Scrève.

David Blevins wrote:
> On Oct 20, 2008, at 2:21 AM, Jean-Sébastien Scrève wrote:
>> Well, I don't see any simple way of doing it.
>> I'm gonna do like in Seam : lookup for a method annotated @Remove  
>> with no
>> parameters and call it if present.
> If you don't mind being bound to OpenEJB internals, you could grab the  
> CoreDeploymentInfo object for the bean and call this method:
>      public List<Method> getRemoveMethods() {
>          return removeMethods;
>      }
> Then invoke one of those methods on the stateful bean proxy.  This of  
> course won't work if the bean didn't declare any remove methods via  
> annotation in it or it's parent class or via the xml deployment  
> descriptor.
> But as I stated before, if you had some sort of need to be able to  
> flush instances without the consent of the bean developer we might be  
> able to think of something if you wanted to describe the motivation of  
> the use case (tooling issue, runtime thing, memory management issue,  
> etc. etc.)
> -David

View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message