If the database is shutdown when the applcation is running what is happened

I am using coneection pool to connect database. If the database is shutdown when the applcation is running what is happened? and how the database will be reconnected.
I am using MySQL 3.23.52, Tomcat 4.1.12

Hi,
Performance of any n-tier system which takes the advantage of connection pooling will be much higher compared to its non-pooled counterpart.
You have to be very careful while designing/using a connection pool.if u are using pool obtained from a third party,ur control on this pool will be limited - with a few set/get methods.
A well designed pool wont create much trouble. if u are creating your own pool, basic steps required are
1.create 'n' number of connections
2.whenever user requests for a connection, check the validity of the connection- by sendin a simple select query etc- and if its not stale,give this connection to the caller.
3.if the connection is stale ie it fails the pretest, close all the connections and create the pool afresh.
4.connections obtained from the pool will be automatically returned back to the pool whenever the applciation call conn.close().
from ur application, follow the steps for each connection you use (not necessary for a well designed pool)
1.call ds.getconnection()
2.check validity of this connection by sending a simple select query.if it works,everything is fine. otherwise something is wrong with connection(not always).
3.sql exception may occur during the execution of sql query. this can be due to either
a.database shut down (network related)
b.database specific - like wrong query,invalid objects etc
you have to look at the sql state/vendor code (which can be retrieved from the caught exception). the retrieved code will give you a hint why the error (network or database specific).and you can act accordingly.
Most of the app servers comes with builtin connection pooling module. and handling stale connection is not a difficult task for the programmer. eg: if you are designing applcations for IBM websphere, you can use StaleConnectionException in your code.if this exception is caught,the whole pool is destroyed and created afresh.
HTH,
-asharafkk

Similar Messages

  • Is it possible to use markers in a Premiere Pro sequence such as Chapter / Comment / Segmentation and export the XMP metadata for a database so that when the video is used as a Video On-Demand resource, a viewer can do a keyword search and jump to a relat

    Is it possible to use markers in a Premiere Pro sequence such as Chapter / Comment / Segmentation and export the XMP metadata for a database so that when the video is used as a Video On-Demand resource, a viewer can do a keyword search and jump to a related point in the video?

    take have to take turns
    and you have to disable one and enable the other manually

  • Suddenly shutdown when the battery is lower than 6%

    suddenly shutdown when the battery is lower than 6% (sometimes lower than 10%)and can not power on anymore, you need to plug the AC to trigger to power on the phone.

    Your battery gauge needs to be recalibrated. When the phone goes off, charge for just a couple of minutes, then run the battery down all the way. If it shuts off above 1% charge again for a couple of minutes, then run down again. Repeat until it actually goes off at 1%. Then charge for 4 hours with the wall charger without using the phone.
    To prevent this happening again, about once a month run the battery all the way down until the phone shuts off, then charge to 100% with a wall charger. (This is actually recommended in Apple's iPhone tips, but they don't say why to do it. The "why" is to recalibrate the battery gauge.)

  • Verify that the database is created with the correct path  specification

    Dear All
    When I installed DB2 9.1 with SP4 on windows 2003 64 bit,I use Configuration Assistant tool which is problem
    SQL1031N  The database directory cannot be found on the indicated file system.  SQLSTATE=58031
    Explanation:
    The system database directory or local database directory could
    not be found.  A database has not been created or it was not
    cataloged correctly. 
    The command cannot be processed. 
    User Response:
    Verify that the database is created with the correct path
    specification.  The Catalog Database command has a path parameter
    which specifies the directory where the database resides. 
    sqlcode :  -1031
    sqlstate :  58031
    Thanks

    Hi Phuc,
    Could you please validate, that the database TST is located in driver H: ?
    If the database is there, you find a directory with the name of your instance under the H: drive, inside this directory, you must find a NODE0000 directory and finally inside the NODE0000 directory there must be a SQL0000? directory, where ? is a number.
    You get your instance name from the environment variable DB2INSTANCE or simply by the execution of:
    db2 get instance
    If there is no SQL0000? directory at all, this means the database is located somewhere else.
    If there is SQL0000? directory in that drive, you can perform the following:
    db2 CATALOG DB TST AS TST ON H:
    And provide the error message, if any.
    Hope this helps
    Best regards, Edgardo

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • I carnt hear my message tone,the sounds it makes when the phone locks and opens.Also i am unable to hear my music playing from my phone but my alarm and ringtone are working.Can anyone help

    i carnt hear my message tone,the sound it makes when the phone locks and opens,also i am unable to hear music when playing from my phone but my ringtone and alarm tone work.Ive made sure the silent button is not on,and the volume button on the side of the phone is just showing it blank instead of it going up and down.To try and fix this i have reset my settings and restored my phone,but now its just skipping the music i have purchased from itunes when in a docking station which is now another problem i have as well.Can anyone help????

    Hello dbrookes,
    Thank you for using Apple Support Communities!
    It sounds like even though the Mute switch is not on, sounds are not making the, well, sound they should, and the volume buttons make a blank volume indicator appear on the screen that does not show the volume level.
    I wanted to recommend a couple of things.
    First, I would reset the phone:
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
    From: iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
              http://support.apple.com/kb/ht1430
    If that does not resolve the issue, then you may want to try backing up to iTunes, and restoring the iPhone again but this time do not restore the backup and set it up as new to see if the issue persists without the previous configuration.
    Just incase you need it, this article will help with that:
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    Cheers,
    Sterling

  • How to Delete the node from cluster when the machine crashed?

    In an three nodes Rac of 11g r2,How to delete the node from cluster when the machine crashed?
    There is now way to repair the machine and have to add a new one.
    What is step to follow up?

    hi
    IF YOU WANT TO DELETE RAC1 NODE
    check $./olsnodes
    1) delete the instance using dbca from any active nodes
    crs_stat -t
    srvctl stop asm -n rac1
    2) delete listener
    3) delete oracle_home from oracle user
    $ORACLE_HOME/bin/runInstaller -updatenodelist ORACLE_HOME=<db_home> "CLUSTER_NODES={RAC1}
    4)delete asm home
    $ORACLE_HOME/bin/runInstaller -updatenodelist ORACLE_HOME=<asm_home> "CLUSTER_NODES={RAC1}
    5) update cluster node
    $ORACLE_HOME/bin/runInstaller -updatenodelist ORACLE_HOME=<db_home> "CLUSTER_NODES={active nodes like rac2,rac3}
    6) update ASm home
    $ORACLE_HOME/bin/runInstaller -updatenodelist ORACLE_HOME=<asm_home> "CLUSTER_NODES={active nodes like rac2,rac3}
    cd $ORA_CRS_HOME
    cd crs/opmn/conf
    check for
    $cat ons.config
    remoteport=6200
    cd crs_home/bin
    $./racgons remove_config rac1:6200
    $ go to crs home
    and $ORA_CRS_HOME/crs/install/rootdelete.sh
    $ORA_CRS_HOME/crs/install/rootdeletenode.sh
    check for ./olsnodes

  • It has been only about a month that i bought my macbook pro 15 but it is heating up really fast on the left side even when the cpu usage is only 10%...i'm worried if this is a problem of the hardware.

    it has been only about a month that i bought my macbook pro 15 but it is heating up really fast on the left side even when the cpu usage is only 10%...i'm worried if this is a problem of the hardware?

    The way something "feels" is very subjective.  We would need to know your actual temps.  You can install the free iStat Pro widget which is available as a download directly from Apple:
    http://www.apple.com/downloads/dashboard/status/istatpro.html
    Let us know what CPU temps you're seeing at the time you feel your machine is hot.  As you indicated your CPU usage was only 10%, that would imply that you already know that heavy CPU usage would be one cause for your machine to be running on the warm side... but that doesn't seem to be the cause here.

  • Hello there, I am creating a database of all our companies press contacts. I would like to create a form that would act as the front end and feed the database which is obviously the back end. The database is in Access 2013. My question is to whether this

    Hello there, I am creating a database of all our companies press contacts. I would like to create a form that would act as the front end and feed the database which is obviously the back end. The database is in Access 2013. My question is to whether this is indeed possible?

    This forum thread appears to point towards the problem.
    Re: Unable to Switch Audio Sync Settings

  • How do I copy/paste full numerical-only account strings into the Projects WebADI template when the account segment fields in the template require use of the dropdown because they're formatted as alpha-numeric values?

    How do I copy/paste full numerical-only account strings into the Projects WebADI template when the account segment fields in the template require use of the dropdown because they're formatted as alpha-numeric values? I'm using the Integrator named "Projects - Transaction Import" and a custom Layout created based on the seeded Layout named "Transaction Import - Accounted". Do I need to somehow change my Layout to make the Document accept numerical values instead of requiring alpha-numeric values? I need to be able to populate the Document with a large amount of transactions and cannot feasibly go through every transaction to add the alpha-valued name of the account segment to every segment that requires it. The segments in particular causing the problem are "Expnd Type" and "Organization Name" which are both alpha-numeric and as such contain the segment number and name; I need to be able to only have to enter the Natural Account Number (6-digit number only) and the Organization Number (5-digit number only).

    How do I copy/paste full numerical-only account strings into the Projects WebADI template when the account segment fields in the template require use of the dropdown because they're formatted as alpha-numeric values? I'm using the Integrator named "Projects - Transaction Import" and a custom Layout created based on the seeded Layout named "Transaction Import - Accounted". Do I need to somehow change my Layout to make the Document accept numerical values instead of requiring alpha-numeric values? I need to be able to populate the Document with a large amount of transactions and cannot feasibly go through every transaction to add the alpha-valued name of the account segment to every segment that requires it. The segments in particular causing the problem are "Expnd Type" and "Organization Name" which are both alpha-numeric and as such contain the segment number and name; I need to be able to only have to enter the Natural Account Number (6-digit number only) and the Organization Number (5-digit number only).

  • I downloaded several cds to my external hard drive in .mp3 format. Later, I copied them to iTunes. The songs only play when the external hard drive is plugged in. I tried to load the songs from iTunes to my iPhone and the songs don't play.

    I downloaded several cds to my external hard drive in .mp3 format. Later, I copied them to iTunes. The songs only play when the external hard drive is plugged in. I tried to load the songs from iTunes to my iPhone and the songs don't play. I thought iTunes allowed me to transfer music to my iPhone and play it. What am I doing wrong?

    Hi skoorb1,
    When adding music to iTunes, you can set it to either make a local copy of the file, or simply point to the original location of the file (for example, on an external hard drive). If it is set to do the latter, it will not be able to play or transfer those files when the external hard drive is not plugged in. You may find the following article helpful:
    iTunes: About the Add to Library, Import, and Convert functions
    http://support.apple.com/kb/ht1347
    Regards,
    - Brenden

  • How to stop the prodution order creating when the product is not valued?

    Hi guyes:
    How to stop the prodution order creating when the product is not valued using CO01?
    I hope that when i create the production order,the system will check the product is valued or not,if not
    the system will show an error or warning message!
    How to config for this?
    Thank you!

    Dear Zhao Gang,
    Check with this user Exits mentioned in this link,
    Prevent Production Order from "Release" if there is no Cost Estimate
    Re: User Exit at Production Order Release
    Check and revert back.
    Regards
    Mangalraj.S

  • The scroll function on my mousepad is disabled when viewing a pdf file in firefox version 5.0. The scroll works on the pdf, but not on the other tabs. When the pdf is closed, the scroll function returns to normal. Any ideas?!

    The scroll function on my mousepad is disabled when viewing a pdf file in firefox version 5.0. The scroll works on the pdf, but not on the other tabs. When the pdf is closed, the scroll function returns to normal. Any ideas?!

    Hey thanx for the help, it worked like a charm.
    I think firefox changed the application lay out, as I used to be able to choose my PDF opener from the list at " Adobe Acrobat Forms Document' where I could choose Nitro-PDF reader, but it has now moved all the way to the bottom like you suggested to the obvious place of "Portable Document Format" section.
    If someone didn't tell me , I wouldn't have scrolled all the way down to be able to find it... it really should be with all its cousins up the top...
    Cheers again..

  • I have several ipod nanos. i can sync one, but since i connected the ipad 2 I am getting an error on two of them, it says cannot sync, error 13019. the loaded songs show on the computer (on the ipods), but not when the ipod is plugged off the usb

    i have several ipod nanos. i can sync one, but since i connected the ipad 2 I am getting an error on two of them, it says cannot sync, error 13019. the loaded songs show on the computer (on the ipods), but not when the ipod is plugged off the usb. Any answers? please

    You can sync your iPod with multiple computers, but what can be synced is very limited.  See this article for more details.
    http://support.apple.com/kb/ht1202
    B-rock

  • Which is better? store files in the database or directly on the O.S.?

    Hi,
    i´m developing an application to manager files. which is better? store files in the database or directly on the O.S.? If i decide to store on database, i will use the BLOB data type but i have a doubt...the BLOB data type occupies the same space on database regardless of file size? there is another data type better?
    Tks,
    Fernando.

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1011065100346196442
    Ask Tom has a bit of info to share on the topic. Have a read of this. :)

Maybe you are looking for

  • Error in installing sap 4.7ee,os 2000

    hi to all when i am installing sap 4.7ee. when i npress the log view.i am gettin an error that is Error 2007-12-31 06:21:25 FJS-00012 Error when executing Script Error 2007-12-31 06:21:25 FJS-00012 Error when executing Script my os is win2000.HDD.160

  • I had downloaded ringtone 60000   and also created ringtone on that but how to use that ringtone

    please let me know how to use the ringtone created using this app

  • How to run Aplet under Servlet?

    Hi! I'am using servletrunner. I have servlet which is in C:JSKD2.0\examples\. Where should I put the *.class (this is aplet) and how to finish this code to run the aplet? out.println("<HTML>\n"+ "<HEAD>\n"+ " <TITLE>Testing...</TITLE>\n"+ "</HEAD>\n"

  • How to get rid of user tip on the screen of windows 8

    hi I do not want the display of "switch between apps" user tip that keeps on populating everytime. How can i get rid of it,please suggest. Thanks In advance. My PC configuration  Link to image 1 Link to image 2 Moderator note: large image(s) converte

  • Calender Help

    Hey all, I am trying to make a week long calendar, it has to be updated every day so that the first date is the current date. I want to be able to have a JTabbed pane with 7 tabs representing the week ahead... so i want the tab id to be the date for