Forums Register Login

Will servlet continue to run after session out?

+Pie Number of slices to send: Send
Hello all:
Can someone please tell me what will happen in the following case?
The user will submit a request to my Mail Servlet, and send out mails one by one for about 1 hour. My session out time limit is 30 minutes. After submitting the mail request, the user will go home so the session will expire after 30 minutes.
My question is will the Mail Servlet continue to execute and send out all the mails? Or the Mail Servlet will stop executing after session out, so do not actually send out all the email? Which one?
Thanks!
+Pie Number of slices to send: Send
hi,
First of all i need some more information regarding your mail servlet to jump to conclusion.
But generally session time out means when user state is inactive (for your case 30 min of inactiveness) session get expired. This means that whatever vaules which have been put in the session will not be available.
Since user will be sending there is no question of inactiveness. Thereby all the mails will be sent.
-arun
[ February 03, 2002: Message edited by: arun boraiah ]
+Pie Number of slices to send: Send
Hi:
I did not explain my servlet clearly. What happens is that after my Mail servlet receives the request from the user, it will retrieve say 700 email address from the DB(not Junk Mail!), and then send out mail message(inputed by the user) one by one in a 5 seconds interval, so the whole process takes about 1 hour.
So after user submits the mail request, user will leave the screen as it is, and go home, (ie, no more activities on the client computer). So in this case, will the session expire after 30 minutes? If so, as long as my mail servlet does not use any session attributes, it will finish the whole execution?
Thanks!
+Pie Number of slices to send: Send
Hello:
plz check web.xml file , and check <session timeout tag>
+Pie Number of slices to send: Send
hi,
As per the servlet concerned. it don't matter what the session time out is. It will complete the request (Since in your case no session attribute present it should). Even browser is close from client's end.
Anyhow test this with very small session time say one min.
-arun
+Pie Number of slices to send: Send
Hi, thanks for the advice.
I think test my servlet with a small session out period , say 1 minute would be a good idea. I think as long as my servlet avoid using session attributes, it should work find.
Thanks
+Pie Number of slices to send: Send
You should never attempt to execute a long-running task from a servlet or JSP. The programming maodel for these constructs is essentially the same as a subroutine call from the browser with the addition of the fact that the browser can time out or otherwise go away. Session timeouts are running against a clock that counts down from the last time a request was sent from that user to the server.
For long-running tasks such as running a spamming server, you should create a stand-alone process to do the back-end work and post work requests to it from the servlet rather than have the servlet attempt to to the heavy work itself.
The knights of nee want a shrubbery. And a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1211 times.
Similar Threads
Notifying user using JSF after the Asynchronous session bean method completes
java mail
session timeouts
session timeouts
how to use session in struts ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 22:33:37.