How to respond immediately?

Hello. I am implementing some chained Servlets to move and manipulate data internally -- there will be no HTML in the response, no presentation of any sort. I am using Servlets only to take advantage of the Server's built-in queuing, scaling and multithreading capabilities, but the protocol here doesn't matter. What's nice is that, if my Servlet isn't ready to handle a request just yet, the Server will hang on to that request for a while. Keeps me from needing a queue. What I don't want, however, is for the client to have to wait until the request has been handled.
Each Servlet does some work and then forwards the request and response on to the next Servlet in the chain. My question is, how can I ensure that as soon as the request is submitted, the client can go on about his business? Don't I have to somehow force the response to be sent back in the first line of code?
When I invoke my first Servlet with Apache Bench, I don't get my prompt back until all the Servlets in the chain have completed their tasks. I realize I can just add "&" to the end of the command-line statement, but that doesn't really solve my problem. I want the Servlet to notify the client immediately that the request was accepted.
Sorry if this is unclear. Hope someone can help.
-Erik

Well, you're a hell of a guy for sticking with me here, but, alas, I tried that, too.
Here is my doPost() in case I am doing something obviously wrong:
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
     System.out.println("Entering doPost in Publisher2");
     String filename = req.getPathInfo();
     try {
     PrintWriter out = res.getWriter();
     out.flush();
     out.close();
     publish(getXMLAsString(filename));
     catch (Exception e) {
     System.out.println(e);
The browser waits until publish() is finished. Tried flushBuffer(), too, as we discussed. I guess the publish() method could spawn a new Thread if there is no other way, but this doesn't seem right somehow. It could be though -- I guess the Thread that's running through doPost() would die just about right after the new Thread was spawned, you know?

Similar Messages

  • ITunes stops responding immediately after opening

    My iTunes stops responding immediately after opening and even force-quit doesn't do.
    Baically it freezes between pressing it and opening the window. In my large library, I can see that it loads it and then nothing more. The menu appears and then the wheel. Force quitting doesn't shut the program, no matter how I do it. It leaves the arrow and the only way is to restart the computer and start again.
    I tried using another account, and it does the same. I tried with a new library. I tried with new prefs folder both on the user and on the Mac HD. I tried reinstalling iTunes. I even tried reinstalling the whole OS X - but nothing. The only thing is that after zapping PRAM it might work once or twice, but no more.
    This is with iTunes 7.0.2, QuickTime 7.1.3 and OS 10.4.8
    I don't know what else to do.
    Any ideas?

    I'm having the same problem. It started recently - maybe about two weeks ago - and occasionally when I launch iTunes it just freezes. I can't force quit it completely - it still shows in the Dock as though it's running, though it's not present in Activity Monitor.
    Curiously, I've also had a couple of kernel panics when clicking iTunes buttons in the past week. I don't recall any system update that might have affected either iTunes or QuickTime, so I'm stumped... The only way to get iTunes back is to log out or restart.
    Kirk

  • Why doesn't siri know how to change the time of a reminder? When asked, "Do you want to confirm or cancel your reminder?" Reply, "Can I change the time to a half hour later?" Siri doesn't know how to respond.

    Why doesn't siri know how to change the time of a reminder? When asked, "Do you want to confirm or cancel your reminder?" Reply, "Can I change the time to a half hour later?" Siri doesn't know how to respond.

    Hi
    In iMovie'11 (version 9.0.x)
    on top menu row - Apple/iMovie/File/Edit/Cut (Can vary dep. on language - in Swedish Apple/iMovie/Arkiv/Redigera/Klipp . . . )
    down Cut menu - Slow playback/Raspid Playback/Re-play in Slow Motion and onvards
    Here one can select the Pre-Set speeds
    Are you familiar with getting 'inspector' to run?
    No - but I guess that Double Click on clip/sequense or ctrl-Click on it might open it.
    Yours Bengt W

  • How to respond on my iPhone when it disabled?

    How to respond on my iPhone when it disabled?

    You don't.  It's disabled.  You need to re-enable it.  What have you done to re-enable it?

  • What's a loss how to respond when iPad?

    What's a loss how to respond when iPad?

    I'm afraid your question makes no sense. perhaps if you rephrase

  • How do I immediately and completely remove podcasts in the latest version of iTunes?

    How do I immediately and completely delete podcasts in the latest version of iTunes?[11.2]

    Using the 'List' tab > Settings.

  • How to respond to IOCTL_MOUNTDEV_QUERY_UNIQUE_ID?

    Hi all!
    I am developing a driver which implement a virtual disk. I am trying to notify MountMgr that a new volume arrive when the volume is mounted. MSDN tell me that I can send MountMgr an IOCTL named IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION to compete it.
    I do so, and MountMgr send to me some other IOCTLs. MSDN says, the most important IOCTL is IOCTL_MOUNTDEV_QUERY_UNIQUE_ID. My driver can elect to ignore others, but must provide an unique ID as the response of it.
    But I find that the input length of this IOCTL is just 4, equal to sizeof(MOUNTDEV_UNIQUE_ID). MSDN says the struct MOUNTDEV_UNIQUE_ID has two member: 
    USHORT UniqueIdLength;
    UCHAR UniqueId[1];
    I think member UniqueId is a variable size string. Length of it should be more than 4. So I write the code below as response:
    status = STATUS_BUFFER_OVERFLOW;
    Irp->IoStatus.Information = need_len;
    The variable need_len is equal to the summarize of the length of my ID string and size of USHORT, that is 2. But MountMgr send this IOCTL with same length buffer again. I don't know how to respond this IOCTL. Should I ignore this length limit and copy my
    ID to AssociatedIrp.SystemBuffer directly? I think if I do so, the pool will be corrupted. The system will come into BSOD, isn't it? If I do nothing, I find the system will come into a wired mistake after a while. What should I do?
    I hope someone could be kind to help me. Thank you!
    Best regards!
    whiteclouds

    When you have one of these calls, you should return STATUS_BUFFER_TOO_SMALL since that is the error indicating that the buffer needs to grow.  For device driver questions, you should really be asking this on the WDK forum
    https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?forum=wdk
    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com
    1. STATUS_BUFFER_TOO_SMALL can't work. I try to set status as it and return, system come into BSOD, windbg tell me the pool was corrupted.
    2. Sorry, before I post my message, I hadn't find here isn't the correct forum. I will post my message at WDK forum again.

  • During typing sporadically keys do not respond immediately.

    Sometimes (not constant) when typing, the key does not respond immediately. If I wait 15-30 sec. Then it responds as we'll as additional keys I may have tapped. Also when attempting to save an email to a specific folder, I tap the "save" icon then in the left when I tap on the specific email account to get to th specific folder, the iPad 4 freezes momentarily and after a few seconds (5-15) it decides to continue. This doesn't happen all the time only intermittently.

    Hi, and welcome to the Palm Community Forums.
    It seems likely that your digitizer (which is the top portion of the screren which recognizes your stylus taps and converts them into commands) is failing, although there are things that you can try to diagnose it.  One thing is to remove any screen protector you have installed, and see if the behavior continues.  The second is to fold over the corner of a piece of paper  and use the folded edge as a "scoop" by sliding it underneath the frame that goes around the screen.  The idea is to pull out any dirt or grit that has accumulated under there over time, which can interfere with the digitizer's function.
    If that does not remedy the problem, you can try one of several software fixes such as DigiFix which can help in some cases.
    If none of that works, you might just be in need of a replacement digitizer.  They can be found at www.pdaparts.com or www.usedpdaparts.com and you can either do the repair yourself, or they will do it for you at a reasonable cost.
    All of these solutions, and more, are discussed in this lengthy thread in the Hardware board.
    Good luck.
    Post relates to: None
    smkranz
    I am a volunteer, and not an HP employee.
    Palm OS ∙ webOS ∙ Android

  • How to respond to itunes on a disabled connect to itunesphone

    how to respond to itunes on a disabled connect to itunesphone

    If your phone is disabled then you will have to connect it to your computer's iTunes : Forgot passcode for your iPhone, iPad, or iPod touch, or your device is disabled.

  • HT4759 attempting to download clo on app to ipad. Step 2 of download process asks for a storage space. Not sure how to respond.

    attempting to download cloud on app to ipad. Step 2 of download process asks for a storage space. Not sure how to respond.

    HHey GB, thanks, this was of great help and should, if you are correct, solve the problem quickly.
    if I am unable to buy 'Hanna' then I am better to use the money (and that for the apparently totally useless iCloud storage!) on my much-needed medications (I am on Disability) OxyContin and Heroin Hydrochloride tablets From my UK pharmacy. Oh, and Gador Alplax bars from Argentina (we only get Xanax brand here and it is the most expensive in the world, and can only be bought in tiny 0.5mg dose meaning I need twelve tablets daily rather than only THREE of the 2mg Alplax 'bars').
    my entertainment via my new iPad is my only real way of forgetting about the pain and anxiety problems I suffer.
    THANK YOU SO MUCH FOR ANSWERING SO QUICKLY!
    Michael in Scotland
    gail from maine wrote:
    Hi Michael,
    You can contact iTunes Support about the movie issue, and Apple Support about the iCloud Storage refund:
    iTunes Support WorldWide
    Apple Support Numbers WorldWide
    Cheers and best of luck!
    GB

  • How to execute immediately a query in a form

    Hi,
    I've got a form which opens another form on which I have created a data block based on a FROM clause query where the where clause has a column joined a GLOBAL variable initialized in the first form.
    How can I get the second form execute immediately the FROM clause query when called from the first form?
    I've tried to insert in the second form called a trigger WHEN-NEW-FORM-INSTANCE where I have the following code.
    BEGIN
    GO_BLOCK('my_block');
    EXECUTE_QUERY;
    END;
    I thougth that the EXECUTE_QUERY executed by default the FROM clause query I've inserted in the Query Data Source Name of the Data Block but I don't see anything when the second form is called by the first form, just the message "FRM-50505 unable to perform query" I've tried to perform the query inserted in the Query Data Source Name executing it directly on the DB and it works
    Thanks!
    Edited by: Mark1970 on 30-mar-2012 3.07

    check from menu or display error to see why do you obtain an error

  • I'm clueless how to respond

    When I get invited to a chat or I invite someone to a chat. The camera comes up it gives me the accept/decline option. I click accept the outlining changes but then it says that the chat cannot go because I didn't respond. I don't understand how I'm not responding especially because sometimes it's me sending the invite. HELP!

    Hi Rdotson:
    Welcome to Apple Discussions!
    Have you opened up the ports in your router?
    This may help:
    http://www.ralphjohnsuk.dsl.pipex.com/page3.html
    or
    http://www.mvldesign.com/videoconferencetutorial.html

  • How to respond to physical block corruption??

    Hi, all.
    As far as I know, there are two types of block corruption.
    1. logical block corruption
    2. physical block corruption
    In case of logical block corruption, there are a few method of how to take care of it.
    such as BMR with rman, media recovery, and dbms package.
    In case of physical block corruption, how can I respond to this type of errors?
    Does physical block corruption of a disk mean disk failure??
    If so, I have to replace the disk? Or, is there any other way to solve
    this type of errors?
    In addition, how can I know that the block corruption is caused by logical problems
    or physical problems??
    Thanks and Regards.

    > In case of physical block corruption, how can I respond to this type of
    errors?
    Round around in circles, screaming at the top of your voice "we're all going to die!".
    Hey, why that funny looks? It works. And it scares the stuffings out of management and colleagues... ;-)
    > Does physical block corruption of a disk mean disk failure??
    If by physical corruption you mean that reading a data block results in I/O errors and a corrupt/incomplete read buffer, then yes. The "disk" is failing - or more correctly, the I/O h/w is failing. It may not be the disk itself. It could be a problem with the HBA, a controller card, etc.
    In exceptional cases it may not even be a h/w issue. It could be a s/w induced error. I once got physical I/O errors reported by Oracle. The problem was traced to an incompatibility between the ASMlib kernel module and EMC Powerpath. The SAN disks & h/w were fine.
    > If so, I have to replace the disk? Or, is there any other way to solve
    this type of errors?
    There should be some kind of diagnostics you can run on the disks to determine if they are failing. Simply replacing a disk because there seems to be a physical corruption problem may not solve the problem itself.
    You need to identify the actual problem. Which means looking at all Oracle traces/dumps in this regard, looking at the kernel logs, manually dumping blocks to see the results, using whatever I/O & disk diagnostic tools available, etc.
    > In addition, how can I know that the block corruption is caused by logical
    problems or physical problems??
    That depends on what you define as logical and physical corruption. The latter means to me that I cannot get the data off the disk without some kind of I/O error. Logical means that the data can be read just fine, but is garbage. Which could simply mean GIGO without implying any kind of underlaying h/w failure.

  • How to respond to install notification?

    Hello.
    Can anyone tell me how a server should respond to install notification from a MIDlet? My server does nothing and my Nokia 3650 complains.....
    Thanks

    Hi, thanks for the reply.
    The thing is, I know it's not a required attribute but I've got a feeling it could be handy - I like the idea of keeping proper tabs on what's going on! The delete notify one appeals to me for the same reason.
    Imagine getting two install notifications from a particular user without getting a delete notification in between...does that mean they have somehow managed to install the app on more than one phone? Because when you get down to it, it's not overly difficult for someone to get a MIDlet off one phone and onto another. Hmm..having said that, I just realised that they could fiddle with, or remove, the install notification URL before installing the app on another phone anyway.
    I installed a program on my 3650 the other day, one for the Symbian OS. To download the app I had to enter the phone's serial number. Wish you could use that sort of check in a Java app.

  • Firefox 29 either will not startup or stops responding immediately

    I just downloaded the latest version of Firefox and immediately found it to be unstable; stopped responding 4 times within minutes of updating. Most of the time all I had to do was click Bookmarks and it would stop responding. Tried searching for help on here and tried a few things including clearing my cache, removing cookies and setting it clear history when it closes... etc
    Now Firefox is completely unusable. Sometimes it won't start at all and when it does startup it immediately stops responding altogether. I have to force it to close by ending the processes. I have tried opening FF in safe mode, resetting it, uninstalling it and going back to ver 28, restarting my laptop... nothing works. Am assuming this is because it remembers my settings each time. I don't want to lose my bookmarks and extensions etc. so don't delete them along with uninstalling FF.
    What can I do to fix this?

    Think I might've found a solution.
    AppData/Roaming/Mozilla/Firefox/Profiles - went into the profile I currently use (left the default one alone) and removed the following: cookies.sqlite, cookies.sqlite-shm and cookies.sqlire-wal.
    Then Firefox started normally and would respond, allowing me to return settings to what they were i.e deselecting 'Clear history when Firefox closes' which I've read is buggy in ver 29.
    Firefox is now working normally and so far hasn't crashed.

Maybe you are looking for

  • Google Play Nexus 6 on Verizon Network C-Block Rules Violation

    Verizon, I have tired for some time to figure out how to activate my Google Play bought Nexus 6 on your network in accordance to C-Block rules. As No rep is able to point me to clearly defined and published procedures and rights I can only assume you

  • My Apple ID is locked for 90 days and can't even purchase anything

    I had my personal Apple ID and I made an second Apple ID for my business. I logged into my iphone6 with that second business apple ID - this apple ID has no credit card information at all. then I tried to log into my personal previous apple ID - this

  • AutoSuggest behavior not always working

    Hi everyone, JDeveloper 11.1.1.5.0 I know how vague the title sounds, sorry for that :-) We want to implement autosuggest behavior on a simple input text. While this simple task seems to work on a normal page, it doesn't so with the structure of page

  • Client copy Only data

    Hi,    We have a copy of production client in Quality system.    This client copy was done few months back, can we update the client in quality with the data which was updated in production after the client copy. Or will I have to do entire client co

  • Substitution in MSS

    How will a manager will know/be advised that a request from an employees for leave, or time for example has been sent up to the next level manager - delegation (due to the line manager not dealing with the request within the 5 working days). Will he