Thanks for this pointer. This looks like it may solve the problem I'm having with thread consumption, but I'm concerned that the implementation might cause issues with frames where a session may make 3 requests to the servlet with different parameters. If the filter takes into consideration the request uri/url then that could be avoided- I'll look up the code and see how it handles the problem.
Thanks, Byron -----Original Message----- From: sven morales [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 12:08 AM To: Tomcat Users List Subject: Re: How to prevent multiple threads per session Hi, Filters. There was a filter code developed by Ivelin Ivanov and Kevin Chipalkowsky that maybe be applicable to your needs. It is called RequestControlFilter. If a user makes two request, A and B then A will be processed first while B waits. When A finishes, B will be processed. If a user makes three or more requests ( e.g. A, B, and C) then the first will be processed (A), and then the after it finishes the last will be processed (C), and any intermediate requests will be skipped (B). aka_sergio --- "Guernsey, Byron (GE Consumer & Industrial)" <[EMAIL PROTECTED]> wrote: > > I have a bit of a problem where deep in a servlet there is some > synchronized code that is synchronized on an object in session. On a > rare occasion, that code runs very slowly when a long report is > running or a database slows. This causes the users of the application > to keep clicking stop and refresh- thinking their request is going to > run. > Recently when the server stopped responding, I did a kill -3 and found > almost all of the threads waiting for that synchronzied session > object- meaning 1 user had managed to consume a large number of > threads be click refresh. > > I realize that I could modify the code to fail out if it couldn't grab > the monitor in a set period of time, but I'd prefer to cancel the > thread that has no web browser endpoint associated with it- the one > that holds the monitor and won't release it until its done with its > query. > Basically, if someone refreshes, I'd like to abort any threads they > already have running- or simply allow tomcat to abort the processing > when the threads endpoint goes away. > > Is there any way I can accomplish this? > > I'm using Tomcat 4.1.31 and Mod_jk2 on apache 2.0.52 > > Thanks, > Byron > > > ============================== > Byron Guernsey > Senior Software Architect > GE Consumer & Industrial Systems > (502) 452 - 5101 > > > __________________________________ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
