Re: Recovery from Network error

From: Andrus Adamchik (
Date: Fri Feb 27 2004 - 12:29:57 EST

  • Next message: Andrus Adamchik: "[ANN] Cayenne 1.1M3 released"

    On Feb 27, 2004, at 3:55 AM, Vassilis Raxenidis wrote:

    > 1. Get a connection from the pool.
    > 2. Perform the query by using this connection
    > 3. Release the connection

    That is exactly how Cayenne works.

    > If the query is to be performed during a network down time then an
    > exception
    > may be thrown.
    > Then query may keep on trying until the network is up again. When the
    > network is stabilized then a valid
    > connection will be returned from the pool and the query will be
    > performed
    > properly.

    This should work ok.

    > It seems that cayenne acquires a connection the first time that the
    > query
    > has to be performed and then uses the
    > same connection in any subsequent query execution.

    Not true... Aside from possible bugs, Cayenne always closes connection
    regardless whether an error has occurred or not. If queries are run in
    a batch (e.g. commit of multiple modified objects), an exception in any
    of the batch queries would terminate the whole batch and close the

    There is a related bug report that may be related to your observations: . It has
    been fixed, but not yet released. A patched version can be downloaded
    from here:
    preview2.tar.gz . Let me know if it fixes the problem. If not, could
    you send a stack trace of exception that happens when attempting to run
    a query over broken connection.


    This archive was generated by hypermail 2.0.0 : Fri Feb 27 2004 - 12:30:04 EST