How to stop Execution of Queries when the Browser closed in middle?

Hi,
I have JSP search page, which takes search parameters from previous page runs queries and display the results. I am using connection pool to connect to AS400 database.
The problem I am facing is... The query still runs on database server, when the user closes browser before getting the search results.
I am closing all my statements and returning connection to pool at the end of the JSP page.
Is there any way to terminate the execution of the queries, when the user closes browser?
Thanks in advance.

Allright.
As you know there is no direct way to catch that event, you will have to do this workaround :
1. Create a class which implements HttpSessionBindingListener. The valueUnbound method will have flag or code to stop running query.
2. Instantiate this in your search page, and add it into session.
3. Add javascript in search JSP to access another(dummy) JSP on unload event(to catch browser closing) something like:
function unload()
location.href = "/kill.jsp";
4. The code in dummy JSP will remove the object from session, and will fire valueUnbound method.
Let me know if this helps.
-Mak

Similar Messages

  • How do i get my navbar to stay on one line when the browser window is minimized?

    I am new to coding and have just created my first website in html and css.  I know that the coding is pretty dire and that I have a lot to learn and hope that someone can guide me in how to solve this problem.  When the browser window is minimized, the navbar breaks down into 2 or 3 lines but I want the navbar to fit to the window whatever the size of the client machine.
    I think I need to add a media query but i'm not sure if i do and if so what code to use and where to put it?
    I am worried that the page will only be viewable properly on a desktop and i really want to learn how to make a fluid layout which can be viewed on 320px, 768px and 1200px.
    Any guidance would be greatly appreciated.
    Here is my code:
    HTML
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>The Engineer's Corset</title>
    <link href="styles/style.css" rel="stylesheet" type="text/css" media="screen">
    <style type="text/css">
    body {
        background-color: #000;
    </style>
    </head>
    <body>
    <div id="container">
    <div id="navbar">
        <ul id="nav">
        <li><span class="current-menu-item">Home</span></li>
        <li><a href="about.html">About Us</a></li>
        <li><a href="workshops.html">Workshops</a></li>
        <li><a href="news.html">News</a></li>
        <li><a href="gallery.html">Gallery</a></li>
        <li><a href="contact.html">Contact Us</a></li>
        </ul>
    </div>
    <div id="header">
      <img src="images/final/headerbeauty3.png" width="1100" height="341" alt="The Engineer's Corset">
    </div>
    <div id="links">
    <ul id="link">
    <li><a href="https://www.facebook.com/Bristolengineer" target="_blank"><img src="images/final/fb3.png" width="200" height="45" alt="Follow Us on Facebook"></li>
    <li><a href="https://twitter.com/Engineerscorset" target="_blank"><img src="images/final/twitter2.jpg" width="200" height="45" alt="Follow us on Twitter"></a></li>
    </ul>
    </div>
    <div class="chantry">
    <img src="images/final/CD Logo fin.png" width="240" height="200" alt="Chantry Dance Company">
    </div>
    <div class="about">
      <p> The Engineer's Corset is a new play written by Janet Goddard for performance by the community of Bristol in 2015. <br>  ~ <br>
    The play is based on the extraordinary real-life events of 1843 surrounding Isambard Kingdom Brunel's near-death experience after swallowing a coin.  We travel through time to explore the adventure and horror of Victorian industrialisation. <br> ~ <br> Using a community theatre group The Engineer’s Corset tells a familiar tale of Brunel’s near death experience when he swallows a gold half sovereign. His wife Mary fights to maintain her composure but is ripped apart by the waiting game. Her servants and his workforce, using dance and sound, broaden her horizons. Just like Mary the audience too will see life in the 1840s through a different lens.</p>
    </div>
    <div class="workshops">
    <img src="images/final/bridgebridge.jpg" width="1100" height="713" alt="clifton suspension bridge">
    <span><a href="workshops.html">We will be running a series of workshops prior to production and hope you will join us.  For further information, click here.</a></span>
    </div>
    <div id="sponsorspace"></div>
    <div id="footer"> <p> &copy; Heartprints Web Design 2014 </p> </div>
    </div>
    </body>
    </html>
    CSS
    @charset "utf-8";
    /* CSS Document */
    body {
        font-family:Arial, Helvetica, sans-serif;
        font-size:125%;
    @media screen {
        #navbar:
    #navbar li {
        font: 25px Arial;
        display: inline;
        list-style-type: none;
        background: #09F;
        color: #000;
        border-radius: 20px;
        padding: 15px 25px;
    .current-menu-item {
        color: #0FF;
    #navbar a {
        padding: 15px 25px;
        background-color: #6cf;
        color: #000;
        text-decoration: none;
        border-radius: 20px;
    #navbar a:hover {
        background-color:#0FF;
        color: #000;
        padding: 15px 25px;
    #header {
        width: 1100px;
        height: 340px;
        margin-left: 50px;
        margin-top: 0px;
        margin-bottom: 0px;
        border-style: ridge;
        border-width: 5px;
        border-color:#09F;
    #links li {
        display: inline;
        width: 700px;
        margin-left: 300px;
    .chantry {
        margin-left: 40px;
    .about {
        position: relative;
        width: 860px;
        text-align:center;
        background-color: #CCC;
        color: #000;
        border-style: ridge;
        border-width: 3px;
        border-color:#09F;
        border-radius: 15px;
        float: right;
        margin-top: -200px;
        margin-right: 90px;
    .workshops{
        position:relative;
        width: 1100px;
        height: 713px;
        font-size:24px;
        margin-left: 50px;
        border-style: ridge;
        border-width: 5px;
        border-color:#09F;
        margin-top: 130px;
    .workshops span {
        position: absolute;
        background: #6CF;
        color: #000;
        left: 30px;
        top: 30px;
        right: 800px;
        padding: 15px;
        font: 1em georgia, serif;
        font-style:italic;
        text-align:center;
        border: 5px solid #09F;
        border-radius: 20px;
        margin-top: 35px;
    .workshops span a {
        color: #000;
    #link li {
        border-style: solid;
        border-color: #6CF;
        padding: 30px 10px 5px 10px;
    .info {
        text-align:center;
        width: 1100px;
        margin-top: 50px;
        margin-bottom: 50px;
    .CDC {
        float: left;
        margin-right: 50px;
        margin-left: 45px;
    .workshopinfo {
        height: 250px;
        text-align:center;
        margin-top: 50px;
    .photos {
        Height: 500px;
        text-align:center;
        margin-top: 50px;
    #footer {
        text-align:center;
        margin-top: 700px;
        color:#0CF;
    .brunel {
        margin-top: 50px;
        margin-left: 400px;
    #workshops2{
        width: 1000px;
        border-style: outset;
        border-width: 5px;
        padding: 15px;
        border-color:#09F;
        background-color: #6CF;
        margin-left: 100px;
        text-align:center;
    #workshops2 a {
        color: #000;
    #sponsorspace {
        height:  300px;
        background-color: #6CF;
        border-style: outset;
        border-color: #09f;
        margin-top: 15px;

    Give #navbar a width that is wide enough to hold all of the buttons within it.
    #navbar {
         width:####px;
    Replace #### with a pixel number large enough to hold the nav buttons.

  • My Mac pro tower has an "ATI Radion hd 2600 XT" video card, and it stopped getting signal to my tv, are there common problems known? How can I troubleshoot this problem when the signal isn't reaching the screen?

    My Mac pro tower has an "ATI Radion hd 2600 XT" video card, and it stopped getting signal to my tv, are there common problems known? How can I troubleshoot this problem when the signal isn't reaching the screen?

    http://discussions.info.apple.com/thread.jspa?messageID=12248238&#12248238
    http://discussions.apple.com/thread.jspa?threadID=2649035&tstart=0

  • I have been sampling new imported drum loops. And if I adjust region to song or time strecth it updates the audio file in the library. How to stop this? I lost the original setting to one loop. automatically doing it ??

    I have been sampling new imported drum loops. And if I adjust region to song or time strecth it updates the audio file in the library. How to stop this? I lost the original setting to one loop. automatically doing it ??

    This "original file cannot be found" thing happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes .
    tt2

  • How to stop a process chain when its running?

    Dear Experts,
    How to stop a process chain when its running? is it that a chain can be stoppend when we open an info package of that chain ?
    Thank you,
    Raj

    Hi,
    Goto the main menu process chain --> choose the remove from the Schudule...
    Regards
    sathis
    I hope it helps to u... please assign the points

  • How to stop iphone from autoplay when plug into car audio system usb?

    how to stop iphone from autoplaying when connected to your car audio USB ?

    You need to remove the association that Windows has with that particular file type. To do that, you need to open Windows Explorer. From there, click on Tools, then Folder options. Click on the tab that is named file types. You then need to find the extension for the photos that appear in the iPhone, then click that registered file type. Once you do that, there is a section to select the program to open that file type with. You can click on the change button, and that will allow you to change the program that it opens with, or restore the default. There is also a box that can be checked to always use the selected program. If you unselect it, it will prompt you next time on what program to use.
    Hope this helps.

  • How do i fix my ipod when the screen cracks

    how do i fix my ipod when the screen cracks

    Have Apple, a third-party place or fix it yur self.
    Apple - Support - iPod - Repair pricing
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens
    DigiExpress.us - The iPad Repair Professionals
    iPod Touch Glass Replacement

  • How can I retrieve my password when the retrials email was not recoverable? I also can't use or pass the othere menace of recovery? Not being able to pass or answer the security questions?

    How can I retrieve my password when the retrials email was not recoverable either? I also can't use or pass the othere means of recovery? Not being able to pass or answer the security questions?
    I created a new ID but never being able to update the iTunes that were purchased/saved using the old id?
    I can't also delete.

    Hi Kazmania89,
    Welcome to the Support Communities!
    If you require additional assistance with this, click on the link below for guidance:
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Once you are able to gain access to the old Apple ID, this article may be helpful:
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    I have purchased music, apps, or books with multiple Apple IDs. How can I get all of this content onto my iOS device?

    First, you need to copy all of your purchased content so it is on the same Mac or PC with iTunes. This computer should be the one you sync your device with. For more information on how to move your content, see these articles:
    Mac:  iTunes for Mac: How to copy purchases between computers
    PC:  iTunes for Windows: How to copy purchases between computers
    Next, authorize your computer to play content with each Apple ID in iTunes. Once your computer is authorized for all your content, it can be synced to your iPhone, iPad, or iPod touch. 
    Cheers,
    - Judy

  • How can i fix a clip when the video and audio are not matching up?

    How can i fix a clip when the video and audio are not matching up? I imported the video from a junkdrive in a .VOB format and concerted to a .mov the videos were filmed on a miniDVD recorder.

    I would try detaching the audio and the dragging the audio to the left or right until it lines up.

  • My ipod went to the ''connect to itunes mode'' and i want to use my itunes backup but how can i do that. also when the ''recover your ipod screen'' appeared i accidentally chose not to show it anymore.

    My ipod went to the ''connect to itunes mode'' and i want to use my itunes backup but how can i do that. also when the ''recover your ipod screen'' appeared i accidentally chose not to show it anymore. please help i just had it for half a day.

    See Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...  Be sure to Follow ALL the Steps...
    Take your time... Pay particular attention to Steps 3 and 4.
    Some users have reported as many as 8 or 9 attempts were necessary before success.
    If the issue persists...
    Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
    Be sure to make an appointment first...

  • How to access my hard drive when the system does not work

    how to access my hard drive when the system does not work

    Startup - Gray, Blue or White screen at boot, w/spinner/progress bar
    Startup Issues - Resolve
    Startup Issues - Resolve (2)

  • How can you download premier pro when the icon doesn't exist in cloud?[was:pr]

    how can you download premier pro when the iucon doesent exist in cloud???

    In order to download the software, your computer must meet the system requirements to run the software.
    http://helpx.adobe.com/x-productkb/policy-pricing/system-requirements-premiere-pro.htmlhttp://www.adobe.com/products/premiere/tech-specs.html
    The usual reason for not being able to download is that Premiere Pro (and other video apps such as After Effects) are 64 bit only so they require a 64 bit computer and a 64 bit operating system.
    If you're running a 32 bit computer and operating system then you will not see the Premiere Pro icon since the software will not run on your computer.

  • How to call a method when the browser is closing

    Hello,
       In my application I need to execute a specific treatment when the WD4A application is closing.  So how can we have a handle method for this specific event.
       I've seen some documentation about the "exit plugs" , and about the doonclose method of the window.. but I don't think it can be useable for me in this case.
    Can you please help me
    Thanks in Advance
    Hamza

    I wrote an insert into the method i set up a break point, the program never call this code and therefore, the new row is never inserted.
    But i think, it's a misunderstand. 
    to summarize :
    I have an application in WD4A
    The application is running, and then I decide to close the browser (in my case internet explorer) and before the browser close I want to execute a piece of code.
    If the method wddoonclose is to be used, is there any default handler or listener to trigger it automatically on the browser closing ?
    If no, how to trigger a method base on this special event .
    Thx
    Hamza

  • How to focus a row directly when the search found the result....in active w

    how to focus a row directly when the search found the result....in active widget

    Considering that I don't understand what you're talking about - does altering the selection of the widget and requesting the focus help?

  • How do I install InDesign CC when the app overview says "up to date" even though I haven´t installed anything yet?

    How do I install InDesign CC when the app overview says "up to date" even though I haven´t installed anything yet?

    It sounds like maybe you installed a trial at some point in the past and trashed the application folder rather than doing an uninstall?
    Have you tried the cleaner tool:
    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6

Maybe you are looking for

  • Error installing ECC6.0 and CRM 7.0 AS Java on windows server 2008

    Hi gurus, I have started an installation for AS java of NW 2004s on windows server 2008. I an facing the following error An error occurred while processing option SAP CRM 7.0 Support Release 1 > SAP Application Server Java > Oracle > Central System >

  • HT3924 Using 2011 27" iMac as a second display.

    I am using a 2012 iMac 27" with a 2011 iMac 27" in target display more via Thunderbolt. Every time the display sleeps the iMac in target display mode's screen stays dark and does not wake up. Even after the recent Thunderbolt Update.

  • Not recognizing SIM card.

    I just updated my iphone to 4.3.5 and it said I had to restore my iphone and then after it finished restoring my computer no longer recognized that it had a SIM card in it. I already tried taking it out and putting it back in and it doesn't work! hel

  • BAPI for Moving average cost

    Dear Experts, I need a bapi to get the moving average cost for a material. in addition i need another bapi  to get the material availability in all plants something like mmbe. please help me.

  • Parental controls for older child

    I have an older child who is the admin on his Mac. He has his own iTunes acct and I know the pw. He also charges all purchases to his own bank card.  I need to monitor his iTunes usage, to find out what he is watching and reading. I don't care about