Skip to main content
September 27, 2010
Question

timeouts for database

  • September 27, 2010
  • 1 reply
  • 769 views

Hi I switched hosting providers about a month ago and have had quite a few issues. Least of which is the one I have now with regards to a connection to the database timeout . When I load my site in a browser, I can click on a page or two. If I leave the pc a few minutes, come back to the pc, click back on the browser window then click the same page again, I get an error saying:

function(){return A.apply(null,[this].concat($A(arguments)))}


Error Executing Database Query.
Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Software caused connection abort: socket write error STACKTRACE: java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65 ) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2744) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1612) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) at com.mysql.jdbc.Connection.execSQL(Connection.java:3277) at com.mysql.jdbc.Connection.execSQL(Connection.java:3206) at com.mysql.jdbc.Statement.execute(Statement.java:727) at com.mysql.jdbc.Statement.execute(Statement.java...

I have emailed back and forth with support and they said I need to set up timeout management in my application. They said "please apply some kind of connection pooling or keepalives."

I have never had this issue until I switched hosting providers. They may indeed set up their database connections differently than other hosting companies. What I would like to know, is there a way to do as they suggest? Set up some kind of connection maintanance within my cfm applications. I'm fairly new to CF, so dont know of anything like this. Thanks for any help in advance!

ps. I posted this in the database forum, but honestly that forum seems dead. Last post 4 days ago. Sorry if I am breaking any rules here by reposting a topic. If I am let me know and I will remove this post.

    This topic has been closed for replies.

    1 reply

    Inspiring
    September 27, 2010

    I have never had this issue until I switched hosting providers. They may indeed set up their database connections differently than other hosting companies. What I would like to know, is there a way to do as they suggest? Set up some kind of connection maintanance within my cfm applications. I'm fairly new to CF, so dont know of anything like this. Thanks for any help in advance!


    Have you got "maintain connections" set against the data source, in CFAdmin?

    That said, I think it's still weird you get this sort of error.  Even if the connection closes, the act of making a new query should request a new connection.

    Give it a go, though.

    ps. I posted this in the database forum, but honestly that forum seems dead. Last post 4 days ago. Sorry if I am breaking any rules here by reposting a topic. If I am let me know and I will remove this post.

    I think the DB forum was the right place for this.  I can't speak for anyone else but I read all the new posts that come in, and whilst I saw your earlier post, I was still mulling over it.  But I just read it again now, paying more attention to what you said (and reading right to the bottom), and came up with something ;-)

    --

    Adam

    September 27, 2010

    Thanks Adam! You're always a big help here. Yes I have enabled "maintain connections" in my CF admin, and even uped the time limit to like 20 minutes for reasons of previous issues I was having. The hosting company said "the MySQL server was configured with the following values:"

    wait_timeout = 300

    connect_timeout = 10

    "They said I should apply some kind of connection pooling or keepalives."

    The problem only seems to arise when I click on my search saubmit button(run a search query) then let it sit for so long, then click back and click submit again. Thats when the error seems to occur. Odd thing is that i also seems random. Sometimes it throws the error, sometimes it doesnt.

    Anyway, if as they suggest there is some code to keep the connection alive for a certain length of time, I havent found it. I am sure there is, but again I thought thats what the "maintain connection" option was for in the CF admin.

    Inspiring
    September 27, 2010

    Thanks Adam! You're always a big help here.  was for in the CF admin.

    Heh.  I think some people would contest that ;-)

    Anyway, if as they suggest there is some code to keep the connection alive for a certain length of time, I havent found it. I am sure there is, but again I thought thats what the "maintain connection" option was for in the CF admin.

    Well... yeah, me too: that's what I thought would do it.  I actually find it rather hard to believe that you need to set have keep alives and that sort of thing.  I don't use MySQL much these days but used to use it all the time, and have never had to do this sort of thing.

    [pauses to reflect the bvllshit I am spouting...]

    Indeed... duh... the side project I am working on right this minute is a MySQL-driven one, now that I think about it (all the DB stuff is already done so I kinda forgot what platform I'm on).  And it's not got "maintain connections" switched on.

    Given you didn't need to do this with your previous provider and I presume everything worked fine, I would be going back to your current provider and asking them why they say you need to do this.  And be firm with the "well how come my previous provider didn't require me to do this... please explain" (although, just in case anyone thinks I am suggesting saying that verbatim, I don't... you know... that's just the basic gist of what you should ask, but be more polite ;-)

    --

    Adam