  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Subject: (New subscriber) "Busy Page " | Subject: (New subscriber) "Busy Page " 2004-10-09 - By Paul Copeland
Back Nic - Can you be more specific about how you "batch away" the transaction? What thread is this transaction running in? JMS would make it asynchronous. You imply some other mechanism would also work. What would that be?
>Date: Fri, 8 Oct 2004 17:57:24 +0100 >From: Nic Ferrier <nferrier@(protected)> >Subject: Re: (New subscriber) "Busy Page" > >Zerbe John W <zerbe.jw@(protected)> writes: > > > >>My preference would be to send a jms message to an MDB and return to >>the browser with a page that does a meta-refresh to keep checking if >>there is a "reply" message. This gets you out of the server so that >>it can service other requests between "checks". Ultimately, it >>should scale better than tying up the servlet thread for "long >>running" operations. It also has the advantage that the mdb can >>potentially be on another machine, again, for scalability. >> >> > >I think you've got the basic idea right but over-complicated the >picture. > >The web is an asynchronous medium. If you have a long transactional >operation the thing you need to do is batch it away for completion and >allow the user to poll the results of the transaction on a separate >page. > >But JMS is a red herring. You can implement this pattern with just a >doGet: > >- collect data from the request > >- setup a session and mark the session as having access to the > transaction you're about to start > >- respond to the client with a page saying "click here to see the > status of your transaction" > >- do your transaction > >- mark your transaction done (by setting the value on the session) > >Implement another doGet to return the state of the transaction. > > >Of course, you can use JMS to batch away the transaction... but it's >not necessary. > > >-- >Nic Ferrier >http://www.tapsellferrier.co.uk > > >
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
|
|
 |