> How would java.nio help you here? The reason I am interested is that we have a kludge where by the processing method (doGet, doPost ....) does not return until the batch transaction is complete. Hence we know that if the connection drops the browser is not interested in the result.
However I am not happy with this kludge, so I think I am going to bite the bullet and implement it properly per Tim Funk's suggestion: > Use some ID to identify the transaction - then use a cookie (or session) > with a META refresh to a page which can use that ID to see how the transaction is progressing. Thanks to both of you, David Yoav Shapira Wrote: > Howdy, > I'll confirm that, not because of a tomcat limitation but because of the > HTTP protocol being stateless. How would java.nio help you here? > > Yoav Shapira > Millennium ChemInformatics > > > >-----Original Message----- > >From: Trott, David [mailto:[EMAIL PROTECTED] > >Sent: Thursday, December 11, 2003 11:15 PM > >To: '[EMAIL PROTECTED]' > >Subject: Detecting HTTP connection state in Tomcat 4.x > > > >Hi > > > >I have a batch transaction that takes a significant amount of time > (more > >than an hour). > >However I have a requirement that the user needs to be able to kick of > the > >transaction from a web interface and be notified when it completes. > > > >I know this isn't the best way to solve the problem, but I was > wondering if > >it would be possible to detect the HTTP connection state from tomcat > 4.x. > >I.e.: I kick off the batch transaction from a Servlet and wait for > either: > > > >- The transaction to complete at which point I notify the user. > >- The http connection is closed (The browser gets closed), at which > point I > >cancel the batch transaction. > > > >NOTE: The reason I am canceling the transaction is because it is > expensive > >to calculate. > > > >I suspect that it not possible to detect the connection state because > >Tomcat > >4.x only requires JDK 1.2, hence it cannot be using NIO. > >As a result there are no methods to "reliably" detect whether the > >connection > >is still open without reading or writing the connection. > > > >However if someone could confirm my assumption (that it is not possible > to > >detect the state) it would be much appreciated. > > > >Thanks, > >David --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
