Re: MySql connection timeout

From: Dave Merrin (dmerri..pasystems.co.uk)
Date: Tue Mar 31 2009 - 10:08:41 EDT

  • Next message: Aristedes Maniatis: "Re: Conditional relationship mapping?"

    >Not sure why you'd want to disable the reconnect if it works

    Actually it's not working on site. At the beginning of every day I'm
    getting this exception:

    ipa.px.data.exceptions.PxDatabaseException: Database error on
    'ipa.printexpress.data.ItemInstance' due to cause: [v.2.0.4 October 8
    2007] Global exception..
        at
    ipa.px.data.loaders.AbstractDataLoader.fetch(AbstractDataLoader.java:124)
        at
    ipa.px.data.loaders.impl.ItemInstanceLoader.getItemInstance(ItemInstanceLoader.java:100)
        at
    ipa.px.logimporter.factory.DefaultProcessorHelper.getItemInstance(DefaultProcessorHelper.java:193)
        at
    ipa.px.logimporter.processor.trackmessage.RipProcessor.processTransmitMessage(RipProcessor.java:86)
        at
    ipa.px.logimporter.processor.trackmessage.RipProcessor.processMessage(RipProcessor.java:53)
        at
    ipa.px.logimporter.processor.DefaultMessageProcessor.processMessage(DefaultMessageProcessor.java:92)
        at
    ipa.px.tracker.logimporter.msgrouter.MessageRouter.run(MessageRouter.java:91)
        at
    ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker.runIt(ThreadPoolWorker.java:154)
        at
    ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker.runWork(ThreadPoolWorker.java:126)
        at
    ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker.access$000(ThreadPoolWorker.java:33)
        at
    ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker$1.run(ThreadPoolWorker.java:80)
        at java.lang.Thread.run(Unknown Source)
    Caused by: org.apache.cayenne.CayenneRuntimeException: [v.2.0.4 October
    8 2007] Global exception.
        at
    org.apache.cayenne.access.DataDomainQueryAction.nextGlobalException(DataDomainQueryAction.java:432)
        at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:261)
        at
    org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:301)
        at
    org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:60)
        at
    org.apache.cayenne.access.DataDomainQueryAction$1.transform(DataDomainQueryAction.java:273)
        at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:836)
        at
    org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:270)
        at
    org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:110)
        at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:746)
        at
    org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:217)
        at
    org.apache.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:54)
        at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1395)
        at
    org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1384)
        at
    ipa.printexpress.datahelpers.Session.fetchEntityCollection(Session.java:172)
        at
    ipa.px.data.loaders.AbstractDataLoader.fetch(AbstractDataLoader.java:120)
        ... 11 more
    Caused by: com.mysql.jdbc.CommunicationsException: Communications link
    failure due to underlying exception:

    ** BEGIN NESTED EXCEPTION **

    java.io.EOFException

    STACKTRACE:

    java.io.EOFException
        at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1934)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2380)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2909)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2998)
        at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:4959)
        at
    org.apache.cayenne.conn.PooledConnectionImpl.getConnection(PooledConnectionImpl.java:133)
        at
    org.apache.cayenne.conn.PoolManager.uncheckConnection(PoolManager.java:391)
        at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:375)
        at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:349)
        at
    org.apache.cayenne.access.DataNode$TransactionDataSource.getConnection(DataNode.java:544)
        at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:251)
        at
    org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:301)
        at
    org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:60)
        at
    org.apache.cayenne.access.DataDomainQueryAction$1.transform(DataDomainQueryAction.java:273)
        at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:836)
        at
    org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:270)
        at
    org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:110)
        at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:746)
        at
    org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:217)
        at
    org.apache.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:54)
        at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1395)
        at
    org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1384)
        at
    ipa.printexpress.datahelpers.Session.fetchEntityCollection(Session.java:172)
        at
    ipa.px.data.loaders.AbstractDataLoader.fetch(AbstractDataLoader.java:120)
        at
    ipa.px.data.loaders.impl.ItemInstanceLoader.getItemInstance(ItemInstanceLoader.java:100)
        at
    ipa.px.logimporter.factory.DefaultProcessorHelper.getItemInstance(DefaultProcessorHelper.java:193)
        at
    ipa.px.logimporter.processor.trackmessage.RipProcessor.processTransmitMessage(RipProcessor.java:86)
        at
    ipa.px.logimporter.processor.trackmessage.RipProcessor.processMessage(RipProcessor.java:53)
        at
    ipa.px.logimporter.processor.DefaultMessageProcessor.processMessage(DefaultMessageProcessor.java:92)
        at
    ipa.px.tracker.logimporter.msgrouter.MessageRouter.run(MessageRouter.java:91)
        at
    ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker.runIt(ThreadPoolWorker.java:154)
        at
    ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker.runWork(ThreadPoolWorker.java:126)
        at
    ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker.access$000(ThreadPoolWorker.java:33)
        at
    ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker$1.run(ThreadPoolWorker.java:80)
        at java.lang.Thread.run(Unknown Source)

    ** END NESTED EXCEPTION **

    Last packet sent to the server was 0 ms ago.
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2592)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2909)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2998)
        at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:4959)
        at
    org.apache.cayenne.conn.PooledConnectionImpl.getConnection(PooledConnectionImpl.java:133)
        at
    org.apache.cayenne.conn.PoolManager.uncheckConnection(PoolManager.java:391)
        at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:375)
        at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:349)
        at
    org.apache.cayenne.access.DataNode$TransactionDataSource.getConnection(DataNode.java:544)
        at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:251)
        ... 24 more

    Andrus Adamchik wrote:
    >
    > On Mar 31, 2009, at 3:52 PM, Dave Merrin wrote:
    >
    >> I'm using the Cayenne PoolManager. I've just turned on the logging
    >> for this class and discovered my connection is timing out. Cayenne is
    >> then attempting a reconnection. Can the reconnection be disabled or
    >> do I need to stop using the PoolManager to get this functionality.
    >
    > Ah right. Forgot about that, as I am using DBCP pools most of the
    > time. Not sure why you'd want to disable the reconnect if it works,
    > but I suggest that you either use a container provided DataSource via
    > JNDIDataSourceFactory or use DBCP pool via Cayenne:
    >
    > http://cayenne.apache.org/doc/using-jndi.html
    > http://cayenne.apache.org/doc/dbcpdatasourcefactory.html
    >
    > Both options are giving you a whole lot of flexibility.
    >
    > Andrus
    >
    >



    This archive was generated by hypermail 2.0.0 : Tue Mar 31 2009 - 10:11:15 EDT