Servlet that never stops...

Hi,
Is possible to do a threaded servlet that never finishes to response? something like a servlet that, when called, connect to a database and send the results of a query to client, update the database and try the query again ... like:
while(true)
rs = stmt.executeQuery("select * from table where flag = 1");
while(rs.next())
os.writeChars(rs.getString(1));
stmt.executeUpdate("update table set flag = 2")
os.flush();
In another place, somebody will insert data in the database, with the flag set to 1 ... so the servlet will ever try to select data that are not sent to client .... then send the new data to client ...
Is this possible? I tried to do something like this, but when I put the thread.sleep() the servlet stopped ... May I do this? I don't know if the server memory will crashes if I do this ... but I really want to try ....
If someone have an example .... to send text, for example .... while(true){out.println("text")} ...
Thanks ....
LMMJ

Allright ... in other words ....
I made a servlet that works ... in the browser it is stopped ... but its thread is already running ... If I insert another registry on my database ... with the flag set up to 1 ... after 5 seconds the flag is changed to 2 by the servlet .... the servlet IS RUNNING .... but I can�t response to browser after the first loop on my thread ... I lost the connection to the browser when I sleeps the thread ... how can I send data to the browser .... make another thing ... and send data again .... without lost the connection? or .... send data to the browser in parts .... this could solve my problem ....
thanks
LMMJ

Similar Messages

  • When I turn on my imac all I see is a white screen, the apple icon and a spinning pin-wheel that never stops spinning.  My computer is stuck!  Any Suggestions?

    When I turn on my imac all I see is a white screen, the apple icon and a spinning pin-wheel that never stops spinning.  My computer is stuck!  Any Suggestions?

    Follow all the steps at > Mac OS X: Gray screen appears during startup

  • The System Preference:Desktop&Screensaver will not open. I get a rotating circle that never stop rotating. I have to do a Force Stop.

    The System Preference:Desktop&Screensaver will not open. I get a rotating circle that never stop rotating. I have to do a Force Stop.

    Quit System Preferences if it's running. In the Finder, hold down the option key and select
    Go ▹ Library
    from the menu bar. From the Library folder, delete the following item, if it exists: 
    Caches/com.apple.systempreferences
    and move the following item to the Desktop:
    Preferences/com.apple.desktop.plist
    Launch System Preferences and test. If you still have the issue, put the item on the Desktop back where it came from and post again. Otherwise, delete the item.

  • My creative cloud app shows a spinning wheel that never stops.  It won't show that I am downloading the photoshop trial.  How do I fix this problem?

    My creative cloud app shows a spinning wheel that never stops.  It won't show that I am downloading the photoshop trial.  How do I fix this problem?

    Sign in, activation, or connection errors | CS5.5 and later
    Mylenium

  • I have owned my MacBook Pro for several months.  Initially, I did not have any problems.  Now I have a problem with Yahoo Mail.  I can open my account, but when I try to get at my mail, 2 out of 3 times I get the spinning ball that never stops.  Now what?

    I have owned my MacBook Pro for several months without having any problems with it. Recently I am having trouble with my Yahoo Mail.  I can open it fine, but 2 out of 3 times when I try to actually open a message, the spinning ball comes on the screen and does not stop. Sometimes, I can log out or force quit and come back in to my account and use it.  Other times, I run into the same problem.  Any suggestions?

    Killerfinch wrote:
    My new yahoo account nestles comfortably in iCloud on the mine iPad.
    No, your Yahoo account is not in iCloud (which only handles iCloud mail), it is in Yahoo, and the Yahoo mail account is on your iPad.
    But the MacBook Pro will have none of it! I write this question now as I fear that I will be totally demented very soon and unable to formulate my thoughts clearly!
    Get the correct settings for your account from Yahoo and set it up manually.
    By the way, I also find the "password" issue problematical. It seems Apple want my Apple password rather than my eMail password. All very confusing.
    That would depend on what you are trying to do.

  • Installed latest muse update, now shows creative cloud window with spinning wheel that never stops. My muse is gone.

    can't figure out how to contact Adobe about this. I'm paying for Muse and can't use it.@

    Mike you can find the relevant portion of the document below:
    Solution 2
    Remove the OPM.db file and relogin into the Creative Cloud desktop application using the Adobe ID tied to your subscription.
    Mac OS: You can locate the OPM.db file in the \User\<user name>\Library\Application Support\Adobe\OOBE folder. To access the hidden user Library folder, see Access hidden user library files | Mac OS 10.7 Lion.

  • Spinning process indicator never stops

    So, I just purchased an iPhone 5C on a Verizon plan. All seems to be set up and working, but I notice that whenever I turn wake the phone, on the main screen beside the WiFi indicator there's what I assume is a spinning process indicator that never stops no matter how long the phone's on. If I return to the main screen from doing anything else, that processor (much like the WiFi "Looking for Networks" process on a Mac) continues to run. Is there a way to keep WiFi but shut this process off?
    -gf

    Hey there Gregory Frost,
    It sounds like your Wi-Fi indicator is constantly spinning as long as the phone is on. I would use the following troubleshooting from this article to help troubleshoot the Wi-Fi connetion on the phone:
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/TS1398
    Restart your iOS device.
    Tap Settings > Wi-Fi and locate the Wi-Fi network to which you're connected.
    Tap and Forget this Network.
    Try to connect to your desired Wi-Fi network.
    Note: You may need to enter your Wi-Fi password again if your network requires one.
    Turn your Wi-Fi router off and on2. If your ISP also provides cable or phone service, check with them before attempting this step to avoid interruption of service.
    Update your device to the latest version of software.
    Update your Wi-Fi router to the latest firmware2. For AirPort Base Stations, install updates using the AirPort Utility.
    Reset network settings by tapping Settings > General > Reset > Reset Network Settings. Note: This will reset all network settings including:
    previously connected Wi-Fi networks and passwords
    recently used Bluetooth accessories
    VPN and APN settings
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • TS2756 hotspot is not working on myiPad 3, hotspot tap is cellural data always appear that it is searching, and never stop. Vodafone and tradeline told me that there is no problem with carrier and Sw. Tethering data is never kept.

    Hotspot appear always to search and never stop
    internet is not working without internet APN data
    Tethering APN  never save the data
    Vodafone carrier checked and mentioned that the no problem with the SIM
    Tradeline checked and the IOS was latest 6.1, but asked to reinstall from scratch
    Please advice

    I have this _same_ issue, exactly.  Initial backup goes just fine, but incremental backups fail.  And like you, I replaced the internal drive.
    The failures didn't start occuring long after the original drive was replaced--which was about 1 year ago.  The new drive was non-Apple and worked fine--and tests fine now as well when outside the TC.  But suddenly incremental backups started failing when the TC firmware and utility app were updated about 2-3 months ago.  I even swapped the internal non-Apple drive for another known-working non-Apple drive, and same results.
    I strongly suspect Apple added something to the firmware to check if it's an Apple or non-Apple drive in the TC and, if the latter, maybe causes incremental backups to fail.  This is only speculation and, obviously, the initial backup still works, so any checksum like this would have to be only during the incremental backup process.
    I'll be checking into this thred to see if others have the same issue, or if a solution is found.  Hopefully my hypothesis is just para-apple-noia and it's some small, easy-to-fix issue.
    -Gizm0d0

  • After applying update my apple tv2 will randomly go to a black screen that lasts for a few seconds. When it gets back to normal after a few seconds it acts like the video never stopped since its farther along in the timeline. This happens with all video c

    After applying update my apple tv2 will randomly go to a black screen that lasts for a few seconds. When it gets back to normal after a few seconds it acts like the video never stopped since its farther along in the timeline. This happens with all video content wether its from Netflix or streaming from my iTunes library

    You might try restarting the Apple TV by removing ALL the cables for a 30 seconds. If that doesn't help try using another HDMI cable.

  • HT4111 while using my aftermarket (Brookstone) IPAD 2 key board the circular search icon never stops moving (setting tab, "Bluetooth" connect)...is that because the Bluetooth is always in the "search" mode while the keypad is in use?

    while using my aftermarket (Brookstone) IPAD 2 key board the circular search icon never stops moving (setting tab, "Bluetooth" connect)...is that because the Bluetooth is always in the "search" mode while the keypad is in use?

    This is the same experience I see with both my iPad and iPhone.  Doesn't seem to cause battery drain, so I just don't worry about it.  My bluetooth devices work and if yours do as well, just don't worry about it.

  • I spend a long time to try to sync my itunes music on my ipod 160 GB Classic, but after waiting so long get a pop up message that itunes stop syncing because of error 46, some times giving me 58, 1469, and many other numbers, please help macbook pro

    i spend a long time to try to sync my itunes music on my ipod 160 GB Classic, but after waiting so long get a pop up message that itunes stop syncing because of error 46, some times giving me 58, 1469, and many other numbers, please help am using macbook pro

    That is precisely what my mid-2010 MacBoook Pro 13 was doing before the drive finally died after an Apple Genius rebooted it a dozen or so times. I have since read about the exact same thing happening to others, including a writer for The Atlantic magazine who had never had an issue with a Mac before. Do a back-up ASAP to make sure you don't lose anything and see about replacing the HDD. It is only about $140 for a new drive. The real issue is if you lose your data, too. So, make sure you do that back-up!

  • A web service that never replies...

    Hi!
    I write a java web service client that sends a soap message to a JAXMServlet that never replies.
    This is the simple client that sends a soap message and waits for the response:
    import java.net.*;
    import java.util.*;
    import javax.xml.soap.*;
    public class MyWebServiceClient {
      public static void main(String[] args) {
        String url = "http://localhost:8080/ws/ws";
        try {
            SOAPConnectionFactory scFactory =  SOAPConnectionFactory.newInstance();
            SOAPConnection con = scFactory.createConnection();
            MessageFactory factory = MessageFactory.newInstance();
            SOAPMessage message = factory.createMessage();
            SOAPPart soapPart = message.getSOAPPart();
            SOAPEnvelope envelope = soapPart.getEnvelope();
            SOAPHeader header = envelope.getHeader();
            SOAPBody body = envelope.getBody();
            URL endpoint = new URL(url);
            SOAPMessage response = con.call(message, endpoint);
            con.close();
        } catch (SOAPException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
    }This is the server that never replies (running on Tomcat 4.1.18):
    import javax.xml.messaging.*;
    import javax.xml.soap.*;
    public class MyWebService extends JAXMServlet implements ReqRespListener {
      public SOAPMessage onMessage(SOAPMessage message) {
        while (true);
        return message;
    }The problem is that the client doesn't receive a response (or a SOAPException) even if I kill Tomcat (and the servlet too)!!!!
    Thank you
    Matteo

    The question is:
    Is it possible to unlock the call method? Is it possible to unlock the call method whith a time out?

  • ITunes 7.6.1...the torture never stops

    I have to say upfront that iTunes 7.6.1 is the worst version. Ever.
    I couldn't use 7.6 because I got spinning beachballs ALL the time. Had to revert backwards. When 7.6.1 came out I gave it a go and things have ben great.
    Until now.
    I decided to rent my first movie via iTunes last night. It's not been played yet, but it seems ever since I DL'ed that rental, iTunes is essentially useless. I can play a song and within 10 seconds the beachball comes up and never stops. I can't play another song. I end up force quitting. I won't even try to play the movie rental for fear it'll freeze up during playback and then I'll be screwed.
    So, it looks like I'll have to go back to a previous version. Again. Make that twice now. I hate 7.6.1 and 7.6. Now I'll have to search the forums to recall how to go back to a stable version rather than watch the movie I downloaded to watch at this time. Then I won't be able to watch the rental on a previous version and I'm screwed out of a rental.
    I won't go back to another version (after I revert today) until 7.7 comes out. I am also irked that Apple apparently is in no hurry to address the many issues this version has. 7.6 acts like a Beta version and I've no idea (other than $$ from rentals) why they released such an unstable version. It's so Un-Apple like and more like the Borg from Redmond rather than the Cats from Cupertino.

    Have you tried it with a different users?
    Repaired permissions?
    Ran Disk First Aid?

  • IPod "Do not disconnect" message never stops

    I get an error message (The iPod "Tubby's iPod" cannot be ejected because it contains files that are in use by another application) when trying to eject my iPod from iTunes and computer. The iPod never appears to be finished with updating even though iTunes software states that the update is complete (“Do not disconnect” message never stops flashing on iPod).
    iPod info: 30GB iPod Video, iPod Software 1.0 (iPod with Video), updated on 11/7/05
    iTunes info: version 6.0.1.3, CD Driver 2.0.4.3, CD Driver DLL 2.0.3.2
    PC   Windows XP Pro  

    I had the same problem and this helped. Hasn't happened again. Good luck..
    http://docs.info.apple.com/article.html?artnum=61135
    Ipod 60gb   Windows XP  

  • Hey guys i was wondering if i could downgrade my iphone 5 from ios 7.1.1 to 7.0.6 or .0.4 i have 7.0.6 and .0.4 shsh blobs but when i try to build a custom ipsw using ifaith it loads and never stop loading is there any way to downgrade to older ios 7 ?

    Hey guys i was wondering if i could downgrade my iphone 5 from ios 7.1.1 to 7.0.6 or .0.4 i have 7.0.6 and .0.4 shsh blobs but when i try to build a custom ipsw using ifaith it loads and never stop loading is there any way to downgrade to older ios 7 ?

    No, you cannot downgrade your iOS device. That's not supported by Apple.

Maybe you are looking for

  • Can Apple TV connect to my stereo speakers via AUX cable?

    I want to turn my old stereo system into "AirPlay" speakers using the AUX port on my stereo. I want to do this so that I can play music through the speakers without being limited in distance by the length of my AUX cable from my iPhone/MacBook to the

  • How do I reverse the displays?

    I see how to rearrange the displays but how do I reverse them?

  • Hard drive icon

    The hard drive icon that is displayed in the top right corner of my computer has always displayed Macintosh HD underneath it. However, today when I came home and sat down at my computer it now displays \\b\b\\ underneath it. Anyone know the reason wh

  • Direct question to Kappy,  OR others #2

    _Now ThiS is odd (to me), while waitng for the last little nudge needed on getting Deja Vu activated __(see hours old ignored post), i checked a coup'la folders in the clone, and it's already mirroring up~to~the~minute !, seemingly. I've specified no

  • Photo Elements 12 Sign-in Loop

    I have recently purchased a update to Photo Elements 12.  It has operated well but has never really allowed me to register properly.  Each time I try to enter Photo Editor it requests a sign-in.  I go through the sign-in procedure but it does accept