Re: Raw SQL on error/exception i v3.0

From: Mike Kienenberger (mkienen..mail.com)
Date: Thu May 14 2009 - 12:36:05 EDT

  • Next message: Borut Bolčina: "Re: 3.0 cache documentation"

    There's lots of ways to get the raw sql. One way is to turn on
    cayenne logging in your application log. That's normally what I do.

    You can also use the p6spy proxy database driver to log all sql.
    That works in any environment, and you can control where the logged
    sql ends up.

    On Thu, May 14, 2009 at 8:09 AM, Andreas Pardeike <a..sys.se> wrote:
    > Hi,
    >
    > our backend database sometimes has strange hickups and the admin
    > kills some of my sql jobs there because they take too much cpu
    > cycles.
    >
    > They now ask me what the raw sql statement was (together with which
    > values were submitted to each '?' in the query) and I cannot easily
    > answer the question.
    >
    > So my question: I have a mix of SQLQuery and SQLTemplate. If I get
    > an exception on a query (in my case a CayenneRuntimeException:
    > Query exception of type "SQLException: The connection does not exist),
    > how do I get the latest sql statement?
    >
    > I found http://www.nabble.com/Auditing-SQL-queries-td21944833.html
    > but am having a hard time to implement the suggestion.
    >
    > Any help appreciated,
    > Andreas Pardeike
    >



    This archive was generated by hypermail 2.0.0 : Thu May 14 2009 - 12:37:01 EDT