EJB Stateful

Hi!

First see the scenario:

I Have one Stateful Bean which name is "BeanSF".

A client request one page and the page made

instance of my BeanSF.

My question is:

When the client close the navigator window or

change the url location to another site,

Can I detect this "event" and destoy my BeanSF?

Thank You!

[386 byte] By [icalv000] at [2007-9-26 3:21:44]
# 1

By page you mean Servlet ?

If the Servlet access the "BeanSF", you don't need to detect the client state.

You manage the connection with the Bean in your Servlet, so you can destroy it in your service method (doGet,doPost) or in the destroy method of the Servlet if you get the Bean reference in init().

Hope this helps.

delattrj at 2007-6-29 11:38:50 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
sorry didn't see you were talking about a stateful bean .. :)if the bean is associated to a client, there's certainly a session ? you can destroy the bean when your client logout ?
delattrj at 2007-6-29 11:38:50 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

Hi!

If the client make a "log out" , i can delete my "BeanSF"

with ejbRemove (I think...)

But , if the client closes his window or change his url how can i detect that the client is out? In my development descriptor can i configure a time out for my session stateful bean and the container can destroy it when the time out exceeds.

I would like to do the same when the client close the window or change the url...

Thanks!!!!

icalv000 at 2007-6-29 11:38:50 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...