Urgent Lost connection during query !

Hi guys,
I'm using Servlet which is running in Linux Operating System and is using MySQL for back-end. This server uses Apache Web Server and Tomcat.
after a moment of inactivty the servlet give me this error message
"Lost connection to server during query"
i initialise my connection into de init() method like this :
public void init(ServletConfig config)
          throws ServletException
     super.init(config);
     // Chargement du driver JDBC
     try
          Class.forName("org.gjt.mm.mysql.Driver");
          connexion = DriverManager.getConnection("jdbc:mysql://localhost/iscom", "login", "password");                         
.... here is the rest of the code i used
public class index extends HttpServlet{
Statement commande=null;
private Connection connexion=null;
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
try
commande = connexion.createStatement();
ResultSet rs = commande.executeQuery("SELECT ...")
}catch
commande.close();
I also use the destroy method
Thank everyone !
Denys

Move your code from init to doGet/doPost. In other words, connect to the database just before firing the query and disconnect after that.

Similar Messages

  • PORTAL LOST CONNECT DURING RUN TIME

    This happens while Portal is running. The HTTP server loses its' connection with
    the database (probably from DAD) a couple of times per day. The more people that access the more down times. I checked everything during the time lost connection: alertlog
    file,error_log file. No specific error in the logfiles. I checked JServ demo
    and Mod_Plsql they are working fine. The only thing you can not connect to http://...../pls/portal30. That means you can't get in to Portal. The HTTP
    disconnects to the DAD in the database.
    Therefore I have to terminate the HTTP server and restart it (sometime even
    need to restart database. If I only restart HTTP,the disconnection happens
    again very soon).
    According to the log files:
    Injserv.log
    [15/02/2001 15:54:22:781 EST] page/Timing Out from FETCHING553
    [15/02/2001 15:54:22:781 EST] page/Timeout occurred, label=553
    url=http://10.5.1.73pls/portal30/!PORTAL30.wwpro_app_provider.execute_portlet
    [15/02/2001 15:54:22:781 EST] page/Timing Out from FETCHING 554
    [15/02/200115:54:22:781 EST] page/Timeout occurred, label=554
    url=http://10.5.1.73pls/portal30/!PORTAL30.wwpro_app_provider.execute_portlet
    [15/02/2001 15:54:22:781 EST] page/Timing Out from FETCHING 555
    [15/02/200115:54:22:781 EST] page/Timeout occurred, label=555
    url=http://10.5.1.73pls/portal30/!PORTAL30.wwpro_app_provider.execute_portlet
    [15/02/2001 15:54:22:781 EST] page/Timing Out from FETCHING 552
    [15/02/200115:54:22:781 EST] page/Timeout occurred, label=552
    url=http://10.5.1.73pls/portal30/!PORTAL30.wwpro_app_provider.execute_portlet
    [15/02/2001 15:54:22:781 EST] page/Timing Out from FETCHING 561
    [15/02/200115:54:22:781 EST] page/Timeout occurred, label=561
    url=http://10.5.1.73pls/portal30/!PORTAL30.wwpro_app_provider.execute_portlet
    [15/02/2001 16:04:08:500 EST] page/oracle.webdb.page.ParallelServlet:init
    [15/02/2001 16:04:08:515 EST] page/Starting a pool of 25 handlers.
    Inerror_log
    [Thu Feb 15 16:03:20 2001] [error] forcing termination of child #0(handle 776)
    Second Example:
    Portal can'nt be accessed by user at approxomately 14:45:
    In jserv.log
    [16/02/2001 14:41:23:203 EST] page/Timing Out from FETCHING 553
    [16/02/2001 14:41:23:203 EST] page/Timeout occurred, label=553
    url=http://10.5.1.73pls/portal30/!PORTAL30.wwpro_app_provider.execute_portlet
    [16/02/2001 14:41:23:203 EST] page/Timing Out from FETCHING 554
    [16/02/200114:41:23:203 EST] page/Timeout occurred, label=554
    url=http://10.5.1.73pls/portal30/!PORTAL30.wwpro_app_provider.execute_portlet
    [16/02/2001 14:41:23:203 EST] page/Timing Out from FETCHING 555
    [16/02/200114:41:23:203 EST] page/Timeout occurred, label=555
    url=http://10.5.1.73pls/portal30/!PORTAL30.wwpro_app_provider.execute_portlet
    [16/02/2001 14:41:23:203 EST] page/Timing Out from FETCHING 552
    [16/02/200114:41:23:203 EST] page/Timeout occurred, label=552
    url=http://10.5.1.73pls/portal30/!PORTAL30.wwpro_app_provider.execute_portlet
    [16/02/2001 14:41:23:203 EST] page/Timing Out from FETCHING 561
    [16/02/200114:41:23:203 EST] page/Timeout occurred, label=561
    url=http://10.5.1.73pls/portal30/!PORTAL30.wwpro_app_provider.execute_portlet
    [16/02/2001 14:47:04:296 EST] page/oracle.webdb.page.ParallelServlet:init
    [16/02/2001 14:47:04:312 EST] page/Starting a pool of 25 handlers.
    InError_log file
    [Fri Feb 16 14:46:31 2001] [error] forcing termination of child#0 (handle 776)
    PARAMETERS
    =============
    KeepAliveTimeout15
    singleThreadModelServlet.initialCapacity=5
    singleThreadModelServlet.incrementCapacity=5
    singleThreadModelServlet.maximumCapacity=10
    I ask the Portal Admin(he use most the time and always he found no connection)
    for any thought about when the down time happen. He said it looks like
    randomly.
    QUESTION
    =========
    What's wrong, and how do i fix it ?

    Use a HashMap to store the arraylists in, and use clientX as the key to the map
    ~Tim
    Message was edited by:
    SomeoneElse

  • Lost connection during calling a stored procedure

    Hallo,
    my webservice runs in a sql-exception
    --> java.sql.SQLException: Getrennte Verbindung
    (lost connection). This is probably during handling the response (conerting oracle types in java types). How i can avoid that the connection will be lost?
    Thanks in advance,
    Frank

    > InitialContext ctx = new InitialContext();
    > DataSource ds = (DataSource)
    > ctx.lookup("jdbc/DataSource_Awel");
    > ConnectionHandle handle = (ConnectionHandle)
    > ds.getConnection();
    > conn = handle.getPhysicalConnection();
    Why are you using directly physical connection to DB ? Use connection object that you get while invoking:
    ds.getConnection();
    Regards,
      Marcin Zduniak

  • Lost connection during update (Toad) how to commit?

    Hi,
    i was running an update statement in Toad, but i lost my connection tot he database. I can see in the sessions that the query is still running, but how can i commit it when it finishes?
    regards,
    Osman

    I was already afraid of it... :( That's not good news :(
    Ok i'll do that.
    regards,
    Osman

  • N95 lost connection during software update

    Hi all,
    am facing a problem i was updating my mob software version .suddenly,i did lost the USB connection with the Mob cause the connection it self was littel bit lose.
    then it stopped updaating.
    since that time till this moment am unable to open my mob it gave me balnk screen with nokia word only..
    please advise?

    See my post from earlier today for things that you can try:
    /discussions/board/message?board.id=swupdate&message.id=33242#M33242

  • Java.sql.SQLException: Lost connection to server during query

    Hi all,
    While I execute the sql query, i get the following exception
    java.sql.SQLException: Lost connection to server during query
         at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
         at org.gjt.mm.mysql.PreparedStatement.executeQuery(Unknown Source)
         at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:302)
    Below is my code to execute the query.
    String sqlQuery = "some query";
        Connection dbConnection=null;
        PreparedStatement stmt = null;
        ResultSet rs = null;
        try
          dbConnection=getDBConnection(); //perform lookup on the data source,   and return the connection
          stmt= prepareStmt(dbConnection, sqlQuery);
          rs = stmt.executeQuery(); //fail here
          //more below......
        catch(Exception e)
          throw e;
        finally
          releaseResource(stmt,dbConnection);
          closeResultSet(rs);
        }The DB i am using is MySql 4.0, Server: Jboss3.2. Could I know the possible reason that will cause the above exception?
    Thanks for your help

    Anyone would help me.
    I am using linux, resin, jdk1.3 and Mysql plus mm.mysql driver. I write some static class which open one database connection for the class. I found that if the Server is ideal for period of time. When I doing the query again I meet same error message.
    ava.sql.SQLException: Lost connection to server during query
    at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
    at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
    at org.gjt.mm.mysql.Statement.executeQuery(Unknown Source)
    at org.gjt.mm.mysql.jdbc2.Statement.executeQuery(Unknown Source)
    at com.ccnet.desktop.Grouping.getDomainBanner(Grouping.java:1835)

  • HT4569 In case of lost internet connection during mountain lion download from app store, do i have to start over?

    In case of lost internet connection during mountain lion download from app store, do i have to start over?

    How do I speed this up.  I have a fast internet connection but this is obviously not right. 
    The speed of the downlaod is dependant on the speed of your Internet connection. "I have a fast Internet connection...," doesn't actually mean anything unless you provide some numbers.
    I have a cable Internet connection with 32 Mbps download speeds, but if you have DSL, you would probably be limited to 1.5 Mbps. Some would call both of these connections "fast," but obviously one is faster than the other.
    What is the speed of your Internet connection?? Don't say, "fast."
    Test it here: http://www.dslreports.com/speedtest?flash=1

  • I cannot install Adobe Flash Player.  I have windows 7 64bit and firefox browser.  During install i get a message 'lost connection', followed by 'trying to reconnect', and then connection failed

    I cannot install Adobe Flash Player. I have windows 7 64bit and firefox browser. During install i get a message 'lost connection', followed by 'trying to reconnect', and then connection failed

    Many thanks for this!   I managed to install the Flash Player with this successfully after many failed attempts before.
    Thanks again
    Jason Pearlson
          From: Jeromie Clark <[email protected]>
    To: Jason Pearlson <[email protected]>
    Sent: Wednesday, March 25, 2015 10:46 PM
    Subject:  I cannot install Adobe Flash Player.  I have windows 7 64bit and firefox browser.  During install i get a message 'lost connection', followed by 'trying to reconnect', and then connection failed
    I cannot install Adobe Flash Player.  I have windows 7 64bit and firefox browser.  During install i get a message 'lost connection', followed by 'trying to reconnect', and then connection failed
    created by Jeromie Clark in Installing Flash Player - View the full discussionPlease use the offline installer Internet Explorer: http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player_ax.exe Firefox and other NPAPI browsers: http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player.exe If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7349939#7349939 and clicking ‘Correct’ below the answer Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7349939#7349939 To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"  Start a new discussion in Installing Flash Player by email or at Adobe Community For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • TS1398 Why I lost my wifi connection during i make a phone call ?

    Why I lost my wifi connection during i make a phone call ?

    If this is a cordless phone that you are taliking about, it is operating on the same frequency as your wireless network, and the phone is creating issues. Unfortunately, this is a common problem.
    A potential solution might be to move the phone as far away as possible from the AirPort Extreme and your computers, or changing the channel on your AirPort Extreme to try to find more clear airspace.
    In my case, I had to go out and find new phones that operated at higher frequencies to solve the issue that I was experiencing.

  • HT1695 Why I lost my wifi connection during i make a phone call ?

    Why I lost my wifi connection during i make a phone call ?

    If this is a cordless phone that you are taliking about, it is operating on the same frequency as your wireless network, and the phone is creating issues. Unfortunately, this is a common problem.
    A potential solution might be to move the phone as far away as possible from the AirPort Extreme and your computers, or changing the channel on your AirPort Extreme to try to find more clear airspace.
    In my case, I had to go out and find new phones that operated at higher frequencies to solve the issue that I was experiencing.

  • Query lost connection to cube

    Hello
    I found that sometimes happens the following : after some changes query lost connection to cube and does not show any data. However, if I create exactly the same query it shows data.
    I deleted query cache, generated it again , saved but nothing helps!
    Can somebody know something about this?
    A

    Hi Dear;
    Pls checked throughly that you might have some restriction which might causing the result of the query no data. To make sure you have the connection with the cube in the change mode of the Query designer click on the technical details button on the query and on the left pannel top you should be able to see the name of the InfoCube.
    BK

  • Lost connection to server

    Can anyone help.when trying to add a project from the creative cloud I get an error saying lost connection to server even though I am signed in to creative cloud.

    Anyone would help me.
    I am using linux, resin, jdk1.3 and Mysql plus mm.mysql driver. I write some static class which open one database connection for the class. I found that if the Server is ideal for period of time. When I doing the query again I meet same error message.
    ava.sql.SQLException: Lost connection to server during query
    at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
    at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
    at org.gjt.mm.mysql.Statement.executeQuery(Unknown Source)
    at org.gjt.mm.mysql.jdbc2.Statement.executeQuery(Unknown Source)
    at com.ccnet.desktop.Grouping.getDomainBanner(Grouping.java:1835)

  • Parental control = lost connection to server

    If parental controls are enabled -- even if child's use (for example, in Content) is not actually limited -- why do Safari and Firefox lose connection? Error message is "Firefox can't establish a connection to the server at [url]" for accounts that are "managed," that is, for which parental controls are enabled. Firefox works fine for all other accounts whether "standard" or "admin." This also happens in Safari: "can't connect to the server "livepage.apple.com"."

    Anyone would help me.
    I am using linux, resin, jdk1.3 and Mysql plus mm.mysql driver. I write some static class which open one database connection for the class. I found that if the Server is ideal for period of time. When I doing the query again I meet same error message.
    ava.sql.SQLException: Lost connection to server during query
    at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
    at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
    at org.gjt.mm.mysql.Statement.executeQuery(Unknown Source)
    at org.gjt.mm.mysql.jdbc2.Statement.executeQuery(Unknown Source)
    at com.ccnet.desktop.Grouping.getDomainBanner(Grouping.java:1835)

  • Nokia Ovi Suite has lost connection with your devi...

    5 months has passed and many hours on the phone to Nokia. The phone has been completely reset /reboot by Nokia time and time again and still the phone gets this message when trying to update software..."Nokia Ovi Suite has lost connection with your device"....We were optimistic that the software upgrade would solve the other problems we are having with all the Nokia phones at work. They are all E52's

    Having the same issue currently with an E72 software version is 054.005.266.02 and Ovi Suite 3.1.1.80
    Actually I had connection lost all the time with all previous versions of Ovi Suite too... it has never been reliable.
    Using original Nokia USB cable, connected securely. Tried different PCs, different USB ports, same issue.
    Just now I'm trying software update and it looses connection during the backup process all the time... very disappointing. Screenshot attached if anybody is interested.
    Attachments:
    nokia_conn_lost.jpg ‏40 KB

  • E5: Ovi Suite has lost connection with your device...

    I am trying to update the software on my E5 using OVI suite but I keep getting an error during the install phase (after backup). The following error and instructions are displayed in the OVI suite window but makes no difference when I follow these instructions (just end up back with the same error).
    "Nokia Ovi Suite has lost connection with your device. Follow these steps to help reconnect your device:
    1. Remove USB cable from your device.
    2. Restart the device (turn off and on again).
    3. Re-insert the USB cable.
    4. Click 'Ok' below to continue updating."
    Current E5 software version is 042.007.
    I am trying to update to E5 software v. 043.115
    Any ideas?

    Yep having the same issue. Just got a replacement handset due to the random restarting issue, soon after setting up the new handset I get a message on phone saying software update is available. Both OVI suite and Nokia software updater say version 43.115 is available (about 200mb in size), I currently have the same version as you 42.007. It claims to do a lot of improvements to the handset. The update downloads fine but when it comes to installing I keep getting the same issue. Phone simply will not restart automatically and the update restarts then fails at the same point over and over. Had the same problem with my previous handset.
    I spoke with my network provider to see if it was an issue with the handset needing firmware specific to them but they said no it is an issue with the firmware itself and has been happening to everyone since its release!!! They said I should not download it until Nokia has resolved the issues with it. But how do I know when that will happen as I cannot find anything put out by Nokia stating there is an issue or anywhere on web forums saying there is actually a problem.

Maybe you are looking for

  • Error in Running a Page in Jdeveloper through VPN

    I am having an issue running a Hello World Page in JDeveloper9i through VPN. When I try to run a page, web browser is trying to open the page based on the Host Name or IP Address used to refer to Embedded OC4J. It would be really great if you could h

  • How to Open a file in Application Server

    Hi All, I am having a recquirement that I had to read the data from an Application Server file, I want to know whether any function modules are there to open a file that is in the Application server. Thankx In advance, Sri.

  • User Account Password Resetting

    Hi All, I have an issue on one site running 10.4.9 server on an Intel XServe where one individual user account continually has the password reset, meaning that she cannot logon. Previously on this server I had the issue with the Password Service cras

  • Job Termination In the source system (TSV_TNEW_PAGE_ALLOC_FAILED)

    Hi Experts,    I have a load in bw which extracts the data from R/3.  In the IP selection i have OLAP variable set to 0calmonth and the selection is one month.  The loads gets failed with the page allocation error in the source system.  I tried reduc

  • Opening old InDesign files

    I can't open older InDesign files.  Can anyone help?