How to handle a Connection Timeout

Hi Everybody,
My situation is as follows: I have a web application, some sort of content management system. I'm using MySQL to store information. The application is obtaining Connection objects via a Connection Pool. I'm runngin Sun Java Application Server 8 Update 1 and MySQL 4.1.9 on a Windows 2003 Server machine.
After 8 hours of inactivity, the system it's raising an exception. Searching the log, I've found the cause, an SQL Exception with a "recv failed" error. Google said that MySQL shuts the idle connections after 8 hours, and also found a code to correctly handling that disconnection. The thing is that the Application Server is handling the connection pool to physically connect with the database, I'm not dealing with connection setup. I've tried setting autoReconnect and autoReconnectForPools properties (in the management console) without success.
Anyone has any idea to correct this?
Thanks in advance for your time.
Best regards
Antonio Varela.

You could execute a query from time to time, but you can't control which connection is being used. For example, you could be accessing the same connection all the time, and in the end only one functioning connection would remain in the pool.
As said in another thread,
The problem (in detail) is how the MySQL JDBC driver operates. The physical connection to the database can fail, but the Connection.isClosed() method will still return false.
So, there seems to be some problem with the MySQL driver.
But even in this case, the "connection validation" options should work on the application server, which they just don't. I am inclined to blame this problem on the connection pool implementation.
The only "solution" I found so far was to set larger connection timeouts on the MySQL server:
interactive_timeout = 2764800
wait_timeout = 2764800

Similar Messages

  • How to handle multiple connection or user with l2cap

    hi friends,
    I need your help please a.s.a.p
    how to handle multiple connection with l2cap protocol in j2me
    sorry,
    I'm a new programmer in j2me
    thanks all...

    Please stick with the original thread http://forum.java.sun.com/thread.jspa?threadID=5200413&tstart=0
    Cross-posting is very rude, and JSch has nothing to do with JSSE, directly. It is an SSH2 API. It does (AFAIK) use some parts of JSSE, but those parts are definately not your problem.
    You already have answers in the other thread.

  • How to handle SQL connection if password Active directory always change? (Connection using Active directory via network SQL 2012 )

    I have 3 server (Web server, database sql 2012 server and Active directory). I'm using sqlsvr version 3.0,  PHP version 5.3 ,IIS version 7 and windows server 2008.
    Right now my php connection to SQL 2012 using AD id, so How to handle if password on active directory change?

    Solved : Using Kaberos

  • How to handle network connection error to bussiness service on OSB

    Hello everyone.
    Thank for your attentions. I need some help for error handling in OSB 11g. I have a proxy service that route to a business service to check profile status. I'm using java client to consume proxy service and return result to customers. The problem that I'm face to is the handling network connection fail.
    I want to get some message (or any useful information) from proxy service to report that connection to Business service is unavailable when that connection fail. I tried to add Error Handling but I cannot found that action from option list.
    Can you review my proxy service and tell me some resolutions?
    Any suggestion is appreciated.
    Thank in advance
    <?xml version="1.0" encoding="UTF-8"?>
    <xml-fragment xmlns:ser="http://www.bea.com/wli/sb/services" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:con="http://www.bea.com/wli/sb/pipeline/config" xmlns:con1="http://www.bea.com/wli/sb/stages/transform/config" xmlns:con2="http://www.bea.com/wli/sb/stages/config" xmlns:con3="http://www.bea.com/wli/sb/stages/routing/config" xmlns:con4="http://www.bea.com/wli/sb/stages/logging/config">
      <ser:coreEntry isProxy="true" isEnabled="true">
        <ser:binding type="SOAP" isSoap12="false" xsi:type="con5:SoapBindingType" xmlns:con5="http://www.bea.com/wli/sb/services/bindings/config">
          <con5:wsdl ref="Test/resources/wsdl/PortalSide"/>
          <con5:port>
            <con5:name>PortalSideSOAP</con5:name>
            <con5:namespace>http://www.example.org/PortalSide/</con5:namespace>
          </con5:port>
          <con5:selector type="SOAP body"/>
          <con5:WSI-compliant>false</con5:WSI-compliant>
        </ser:binding>
        <ser:monitoring isEnabled="false">
          <ser:aggregationInterval>10</ser:aggregationInterval>
          <ser:pipelineMonitoringLevel>Pipeline</ser:pipelineMonitoringLevel>
        </ser:monitoring>
        <ser:reporting>true</ser:reporting>
        <ser:logging isEnabled="true">
          <ser:logLevel>debug</ser:logLevel>
        </ser:logging>
        <ser:sla-alerting isEnabled="true">
          <ser:alertLevel>normal</ser:alertLevel>
        </ser:sla-alerting>
        <ser:pipeline-alerting isEnabled="true">
          <ser:alertLevel>normal</ser:alertLevel>
        </ser:pipeline-alerting>
        <ser:ws-policy>
          <ser:binding-mode>wsdl-policy-attachments</ser:binding-mode>
        </ser:ws-policy>
      </ser:coreEntry>
      <ser:endpointConfig>
        <tran:provider-id>http</tran:provider-id>
        <tran:inbound>true</tran:inbound>
        <tran:URI>
          <env:value>/Test/proxy-services/DnICT_WSDL_PS</env:value>
        </tran:URI>
        <tran:inbound-properties/>
        <tran:all-headers>false</tran:all-headers>
        <tran:provider-specific>
          <http:inbound-properties/>
        </tran:provider-specific>
      </ser:endpointConfig>
      <ser:router>
        <con:pipeline type="request" name="GetRequestInfo_pipeline_pair_request">
          <con:stage name="InputProcess_stage">
            <con:context>
              <con2:varNsDecl namespace="http://www.example.org/PortalSide/" prefix="por"/>
              <con2:varNsDecl namespace="http://www.example.org/PortalSide_Test/" prefix="por1"/>
              <con2:varNsDecl namespace="http://www.example.org/OutputSchema" prefix="out"/>
            </con:context>
            <con:actions>
              <con1:assign varName="docId">
                <con2:id>_ActionId-2456490176600649155--723117a.130d7d91065.-7b86</con2:id>
                <con1:expr>
                  <con2:xqueryText>$body/por:checkStatus/documentId/text()</con2:xqueryText>
                </con1:expr>
              </con1:assign>
              <con1:assign varName="depId">
                <con2:id>_ActionId-2456490176600649155--723117a.130d7d91065.-7b69</con2:id>
                <con1:expr>
                  <con2:xqueryText>$body/por:checkStatus/departmentId/text()</con2:xqueryText>
                </con1:expr>
              </con1:assign>
              <con1:assign varName="srvId">
                <con2:id>_ActionId-4566721321360037228--34ba1746.13170e34dc9.-7d41</con2:id>
                <con1:expr>
                  <con2:xqueryText>$body/por:checkStatus/serviceId/text()</con2:xqueryText>
                </con1:expr>
              </con1:assign>
            </con:actions>
          </con:stage>
        </con:pipeline>
        <con:pipeline type="response" name="GetRequestInfo_pipeline_pair_response">
          <con:stage name="ErrorHandling">
            <con:context/>
            <con:actions/>
          </con:stage>
        </con:pipeline>
        <con:flow>
          <con:pipeline-node name="GetRequestInfo_pipeline_pair">
            <con:comment>Lay cac thong tin trong form search</con:comment>
            <con:request>GetRequestInfo_pipeline_pair_request</con:request>
            <con:response>GetRequestInfo_pipeline_pair_response</con:response>
          </con:pipeline-node>
          <con:branch-node type="condition" name="branching_public_services">
            <con:context>
              <con2:varNsDecl namespace="http://www.example.org/PortalSide/" prefix="por"/>
            </con:context>
            <con:branch-table variable="depId">
              <con:branch name="SoTTTT">
                <con:operator>equals</con:operator>
                <con:value>1</con:value>
                <con:flow>
                  <con:branch-node type="condition" name="DnICT_dept_services">
                    <con:context/>
                    <con:branch-table variable="srvId">
                      <con:branch name="DichVu_1">
                        <con:operator>equals</con:operator>
                        <con:value>1</con:value>
                        <con:flow>
                          <con:route-node name="RouteToDnICT_BS">
                            <con:context>
                              <con2:varNsDecl namespace="http://www.example.org/PortalSide/" prefix="por"/>
                              <con2:varNsDecl namespace="http://www.example.org/PortalSide_Test/" prefix="por1"/>
                              <con2:varNsDecl namespace="http://www.example.org/OutputSchema" prefix="out"/>
                            </con:context>
                            <con:actions>
                              <con3:route>
                                <con2:id>_ActionId-4566721321360037228--34ba1746.13170e34dc9.-7b4c</con2:id>
                                <con3:service ref="Test/busines-services/DnictServiceBS" xsi:type="ref:BusinessServiceRef" xmlns:ref="http://www.bea.com/wli/sb/reference"/>
                                <con3:operation>selecttrangthai</con3:operation>
                                <con3:outboundTransform>
                                  <con1:assign varName="username">
                                    <con2:id>_ActionId-4566721321360037228--34ba1746.13170e34dc9.-7b4b</con2:id>
                                    <con1:expr>
                                      <con2:xqueryText>fn:string('stttt')</con2:xqueryText>
                                    </con1:expr>
                                  </con1:assign>
                                  <con1:assign varName="password">
                                    <con2:id>_ActionId-4566721321360037228--34ba1746.13170e34dc9.-7b4a</con2:id>
                                    <con1:expr>
                                      <con2:xqueryText>fn:string('123456')</con2:xqueryText>
                                    </con1:expr>
                                  </con1:assign>
                                  <con1:replace contents-only="true" varName="body">
                                    <con2:id>_ActionId-4566721321360037228--34ba1746.13170e34dc9.-7b49</con2:id>
                                    <con1:expr>
                                      <con2:xqueryText><![CDATA[<soap:selecttrangthai       xmlns:soap="http://soapinterop.org/">
         <username       xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">{$username}</username>
         <password       xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">{$password}</password>
         <masohoso       xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">{$docId}</masohoso>
    </soap:selecttrangthai>]]></con2:xqueryText>
                                    </con1:expr>
                                  </con1:replace>
                                </con3:outboundTransform>
                                <con3:responseTransform/>
                              </con3:route>
                            </con:actions>
                          </con:route-node>
                        </con:flow>
                      </con:branch>
                      <con:default-branch>
                        <con:flow/>
                      </con:default-branch>
                    </con:branch-table>
                  </con:branch-node>
                </con:flow>
              </con:branch>
              <con:branch name="SoGTVT">
                <con:operator>equals</con:operator>
                <con:value>2</con:value>
                <con:flow/>
              </con:branch>
              <con:default-branch>
                <con:flow/>
              </con:default-branch>
            </con:branch-table>
          </con:branch-node>
        </con:flow>
      </ser:router>
    </xml-fragment>P/S:
    When connection to business service is fail, I got this soap message:
    <soapenv:Envelope       xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         <soapenv:Body>
         <soapenv:Fault>
         <faultcode>soapenv:Server</faultcode>
         <faultstring>BEA-380002: No route to host</faultstring>
         <detail>
         <con:fault       xmlns:con="http://www.bea.com/wli/sb/context">
         <con:errorCode>BEA-380002</con:errorCode>
         <con:reason>No route to host</con:reason>
         <con:location>
         <con:node>RouteToDnICT_BS</con:node>
         <con:path>request-pipeline</con:path>
         </con:location>
         </con:fault>
         </detail>
         </soapenv:Fault>
         </soapenv:Body>
         </soapenv:Envelope>Regards.
    Cuong Pham
    Edited by: Doubt_Man on Jul 28, 2011 10:26 AM

    you could add an error handler on the route-action in your proxy service.
    in there you could investigate the $fault variable and for example check which BEA-... errorcode comes back.
    then you can decide what to reply back..for example create your own soap-fault and set your own messages.
    now the default $fault generated by the osb itself will get returned
    http://www.xenta.nl/blog/2010/07/17/oracle-service-bus-11g-handling-soap-faults/
    maybe that one helps you a bit

  • How to set TCP connection timeout in solaris 9

    Hello All,
    I am new to solaris. While using oracle, sometimes I face tcp connection timeout.
    The timeout happens after a long delay like more than 8 min. I want to reduce the tcp connection timeout to 2 min in solaris.
    Please help me to change this setting.
    My current configuration is
    SunOS testmachine 5.9 Generic_122300-13 sun4u sparc SUNW,Sun-Fire-V440
    Thanks
    Purushoth

    There's a fair amount of tunables. Without known what is timing out (dns, lost packet...), it's hard to say what you want to tweak. The list of parameters can be seen by using ndd:
    ndd /dev/tcp \?
    or
    ndd /dev/ip \?
    and can be set by using ndd -set (see ndd(1M) ). Note that anything you set has to be reset on reboot, so you have to stick this in a script somewhere, or know what the variable translates to to stick it into /etc/system.
    -r

  • How to handle multiple connection through JCO

    Hello JCo Experts,
    My requirement is as follows:
    > I need to create a Web Dynpro Java Application
    > I have multiple users (different Users on SAP System).
    > I need to execute BAPI/Module Functions through these multiple users.
    Example:
    Users: A and B
    User A has logged in from a remote location
    User B has logged in from a another remote location
    both users have logged in through SAP system Login Ids
    Two JCo Connections should be created and all the request from User A must use Connection A and request from B must use Connection B.
    > The connection should be created at first time when user login first time.
    How can I handle this scenario through JCo or other way. I have multiple BAPI/ModuelFunction which I need to execute but with User specific.
    waiting for positive response.

    Dear Shiv,
    Please need to look into [How to Configure the JCo Destination Settings|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/3103eb90-0201-0010-71af-be6f4a6f61d1]
    http://wiki.sdn.sap.com/wiki/display/Snippets/DynamicJCOHandling-Creation,Updationetc
    Best Regards
    Arun Jaiswal

  • HOW to handle JCO connection failure

    if i have a JCO connection.....to process the RFC function...
    when i call the function...the job leave to R3 to do the rest...
    yet ..the connection broken..at this time..
    the is no result return..and consequency receive the
    RFC_ERROR_COMMUNICATION exception...
    how do i handle this kind of situation....
    what should R3 SHOULD DO..
    let's say i have a jco connection
    the connection broken during processing...how do i return the error message to the java program
    the error include....RFC_SYSTEM_FAILURE ,RFC_ERROR_COMMUNICATION
    Message was edited by:
            yzme yzme

    Yzme,
    You have already got answers how to catch this exception.
    Next processing depends on application-specific nature of RFC: whether or not call is idempotent, in simple words -- submitting same request doesn't hurt.
    This comes from the fact that network failure may occurs when transferring request (hence no background processing performed) or when returning response (hence function already executed).
    For idempotent calls there is also an option for automatic re-tries finite number of times. For non-idempotent calls the only option is to display error to user in friendly format.
    An idempotent call is a call that can be executed more than once on the server without undesirable side effects. Take for example Create / Read / Update / Delete operations. Obviously, read is idempotent while it doesn't alter data at all. You may treat Delete as idempotent up to certain extent -- just handle "record not exists" gracefully. Create and Update are not good candidates -- re-submitting same request typically leads to serious problems like duplicate entries or data inconsistency.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • How to handle multiple connection with ssh using JSCH Client?

    Hi,
    Can anybody help me regarding the topic said above?
    Thanks in advance.

    Use this forum to discuss general topics related to the Java programming language.
    I don't even know what JSCH is, let alone would kno whow to provide product support for it.

  • How to make a socket connection timeout infinity in Servlet doPost method.

    I want to redirect my System.out to a file on a remote server (running Apache Web Server and Apache Tomcat). For which I have created a file upload servlet.
    The connection is established only once with the servlet and the System.out is redirected to it. Everything goes fine if i keep sending data every 10 second.
    But it is required that the data can be sent to the servlet even after 1 or 2 days. The connection should remain open. I am getting java.net.SocketTimeoutException: Read timed out Exception as the socket timeout occurs.
    Can anyone guide me how to change the default timeout of the socket connection in my servlet class.
    Following is the coding to establish a connection with the Servlet.
    URL servletURL = new URL(mURL.getProtocol(), mURL.getHost(), port, getFileUploadServletName() );
    URLConnection mCon = servletURL.openConnection();
    mCon.setDoInput(true);
    mCon.setDoOutput(true);
    mCon.setUseCaches(false);
    mCon.setRequestProperty("Content-Type", "multipart/form-data");
    In the Servlet Code I am just trying to read the input from the in that is the input stream.
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    BufferedInputStream in = new BufferedInputStream(req.getInputStream());
    byte [] content = new byte[1024];
    do
    read = in.read(content, 0, content.length);
    if (read > 0)
    out.write(content, 0, read);
    I have redirected the System.out to the required position.
    System.setOut(........);
    Can anyone guide me how to change the default timeout of the socket connection in my servlet class.

    I am aware of the setKeepAlive() method, but this can only used with the sockets. Here i am inside a servlet, have access to HTTPServletRequest and HTTPServletResponse and I don't know how to get access to the underlying sockets as the socket handling will be handled by the tomcat itself. If I am right there will be method in the apache tomcat 6.0.x to set this property. But till now I am not getting it.

  • My MacBook Pro persistently will not connect to my wireless router. The message "connection timeout" appears. What is a connection timeout and how can I fix?

    My MacBook Pro persistently will not connect to my MiFi Verizon wireless router. The message "connection timeout" appears. What is a connection timeout and how can I fix?

    Hi there terri900!
    You may want to try configuring your router settings to match the recommended settings for iOS and OS X devices, which can be found here:
    iOS and OS X: Recommended settings for Wi-Fi routers and access points
    http://support.apple.com/kb/ht4199
    You may also find some helpful information for troubleshooting this issue in this article, which can help you with any manner of issues with Wi-Fi connections:
    Wi-Fi Quick Assist
    http://support.apple.com/kb/HT1145
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • I'm trying to connect to my home wifi with my imac gh5. After I enter the password it says connection timeout or password incorrect. I know there's no issue with the connection but I don't know what else to do. Does anyone know how to fix this problem?

    I'm trying to connect to my home wifi with my imac gh5. After I enter the password it says connection timeout or password incorrect. I know there's no issue with the connection but I don't know what else to do. Does anyone know how to fix this problem?

    What is the make & model of your home Wi-Fi router that you are attempting to connect your G5 iMac to? Which exact model of iMac do you have?
    What wireless security type is your router using: WEP, WPA, or WPA2? If you temporarily disable wireless security, can the iMac connect to it now?

  • I lost my connection when I was using internet and when I want to reconnect to airport it give me connection timeout error, I changed my password on router but still doesn't work. How can i fix my problem?

    Hi,
    I lost my airport connection when I was using internet and when I wanted to re-reconnect to airport it gave me connection timeout error, I changed my password on router but still doesn't work. How can i fix my problem?

    Hello there hastibahreini,
    It sounds like you were using your Wi-Fi network from your Airport base station and the connection cut out. You have reset the password on the device but the issue persists. I would try the 3 resets outlined in the following article in order to help resolve the issue. If it persists, is the Wi-Fi connection issue happening on more than one device or computer?
    Resetting an AirPort base station FAQ
    http://support.apple.com/kb/ht3728
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • Handling the ORA-12170: TNS:Connect timeout in a procedure

    Post moved to:
    Handling the ORA-12170: TNS:Connect timeout in a procedure
    Edited by: John_75 on Jun 28, 2010 9:33 AM

    http://download.oracle.com/docs/cd/B19306_01/network.102/b14212/troublestng.htm#i440403
    will give you
    http://download.oracle.com/docs/cd/B19306_01/network.102/b14212/troublestng.htm#CEGEDBIE

  • Handle WSDL data connection timeout during PDF generation

         I have created in LiveCycle Designer XDP template. In template i defined WSDL Data connection. For data loading i call xfa.connectionSet.WsDataConnection.execute(0).
         For PDF generation i created LiveCylce process and use generatePDFOutput component.
    If WebService works output service generates document with all data - OK.
    If i turn off webservice and run process ouputservice generates PDF document with empty fields. Is where any possibility to raise execption to calling process if WSDL connection timeouts or gives SOAP fault error in response? 
    I want catch web service errors in process and do not generate PDF if some webservice used in PDF template is not accesible during generation.

    Hi Martin,
    We are experiencing the same issue with SAP/Vertex. Can you let me know how you resolve this? Did you change the SAP gateway timeout parameter? If so, which one is it?
    Your help on this is greatly appreciated.
    Thanks much!
    Best regards,
    Cyanna

  • WSA S160 Support for Terminal Servers (How are terminal server connections handled?)

    We have a terminal server environment with a mixture of computers and laptops. Currently we have multiple proxy servers and would like to considate down to one. Our current solution does not work well in a terminal server environment. We are looking for a way to integrate all equipment with one soluton and I was curious as to how the S160 handled users connecting via a terminal server.

    Edadios thanks for the response. I was reading over this document (see attached), and it looks to me like the connection would be tracked via a cookie surrogate. My bigger concern is that we are looking to be able to track usage per user even though they are on a terminal server. Our current solution (Barracuda) is not able to perform this function. I am hoping to have a S160 on site this week to do some testing but was hoping to gather some intel in the forums prior to implementation.
    The response helps clear up what protocols are in use but I am still wondering how terminal server connections are handled by the WSA and if they are truly handled and tracked per user instead of by the device they are connecing to.

Maybe you are looking for

  • Cannot Send Mail using AIM account.

    I can receive mail fine but when I try to send mail I get the following message: Cannot send mail using the server smtp.aim.com:EmilyLozano. Use the pop-up menu below to try a different outgoing mail server. All messages will use this server until yo

  • How do I unblock my iPhone 4. A friend bring it to me from Canada

    How do I unblock my iPhone 4. A friend bring it to me from Canada

  • Can't install XP version of Creative Recor

    I recently upgraded to Windows XP (clean install SP2) and installed the drivers and programs that I received on a cd when I purchased my sound card. I then updated the drivers on Creative.com so they would work with XP (Li'veDrvUni-Pack(ENG).exe, Li'

  • Tracking a stolen Ipod Touch

    My Ipod was stolen about a week ago. I accidentally removed the device from Icloud but it is still hooked on my ipod. Is there something I can do?

  • Implementing BADI ALM_ME_001_ORDER

    Hi All, <i>MAM30 SR1</i> <i>MI25 SP15</i> I followed the guide for implementing BADI ALM_ME_001_ORDER to get more fields for the ORDER_OPERATION details. In the MI server, merep_mon says my fields and values are there and enhancement flags, and so as