Re: Database reconnect support? [Oracle 9i]

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Jul 07 2004 - 18:15:34 EDT

  • Next message: Fredrik Liden: "Cayenne in a framework -> Value Objects"

    I looked through 15+ database reconnect errors, and they all threw exceptions
    on these three pieces of code (and primarily the last two -- in all but two
    cases).

    I'm hoping that dealing with the exception in these three cases is
    sufficient to handle 99% of the reconnecting problems.

    Looking at the code in getConnection makes me think that an error in this
    code needs to retry the whole connection, so I'm going to try updating
    PoolManager.getConnection() with two reconnecting error traps and see if
    that helps.

    -Mike


    Caused by: java.sql.SQLException: Closed Connection
            [...]
            at
    oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:1077)
            at
    org.objectstyle.cayenne.conn.PooledConnectionImpl.(PooledConnectionImpl.java:171)

    Caused by: java.sql.SQLException: Io exception: Connection reset
            [...]
            at
    oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3059)
            at org.objectstyle.cayenne.access.DataNode.runSelect(DataNode.java:362)

    Caused by: java.sql.SQLException: Closed Connection
            [...]
            at
    oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:1077)
            at
    org.objectstyle.cayenne.conn.PooledConnectionImpl.getConnection(PooledConnectionImpl.java:171)
            at
    org.objectstyle.cayenne.conn.PoolManager.getConnection(PoolManager.java:434)

    Caused by: java.sql.SQLException: Can't obtain connection. Request timed
    out. Total used connections: 1
            at
    org.objectstyle.cayenne.conn.PoolManager.getConnection(PoolManager.java:424)



    This archive was generated by hypermail 2.0.0 : Wed Jul 07 2004 - 18:15:16 EDT