FAQ

-----Ursprüngliche Nachricht-----
Von: Andrus Adamchik
Gesendet: Dienstag, 24. April 2007 16:21
An: user@cayenne.apache.org
Betreff: Re: AW: postgres, idle in transaction

On Apr 24, 2007, at 5:17 PM, Andrus Adamchik wrote:

Interesting... Looking at your log I see this:

15:33:08.267 (2) FE=> Parse(stmt=S_1,query="BEGIN",oids={})
.....
15:33:08.268 (2) FE=> Parse(stmt=null,query="SELECT ....
....
15:33:28.461 (2) FE=> Parse(stmt=S_2,query="COMMIT",oids={})


So transaction is clearly committed. But of course connection is
not closed. It is returned to the pool instead. Still looks like a
driver bug to me.

Andrus
Sorry, you said "sometimes". Just noticed that the first case indeed
doesn't commit. Just thought of another potential source of leaks -
Cayenne iterated queries. Are you using any of those?
No, we are not using performIteratedQuery() with postgres.

Is there another possibility to debug this problem or verify if this is maybe a cayenne or jdbc-postgres bug?

Oilid

Search Discussions

  • Andrus Adamchik at Apr 24, 2007 at 3:20 pm
    I just uploaded a patched 1.2 build with Cayenne connection pool
    rolling back transactions before returning them to the pool. Can you
    try it out (of course resetting DBCP data source back to Cayenne):

    http://people.apache.org/~aadamchik/patched/cayenne-nodeps-1.2.3-dev.jar

    I don't have too much hope this will fix it... but still worth a try.

    Andrus

    On Apr 24, 2007, at 5:28 PM, Oilid Adsi wrote:

    -----Ursprüngliche Nachricht-----
    Von: Andrus Adamchik
    Gesendet: Dienstag, 24. April 2007 16:21
    An: user@cayenne.apache.org
    Betreff: Re: AW: postgres, idle in transaction

    On Apr 24, 2007, at 5:17 PM, Andrus Adamchik wrote:

    Interesting... Looking at your log I see this:

    15:33:08.267 (2) FE=> Parse(stmt=S_1,query="BEGIN",oids={})
    .....
    15:33:08.268 (2) FE=> Parse(stmt=null,query="SELECT ....
    ....
    15:33:28.461 (2) FE=> Parse(stmt=S_2,query="COMMIT",oids={})


    So transaction is clearly committed. But of course connection is
    not closed. It is returned to the pool instead. Still looks like a
    driver bug to me.

    Andrus
    Sorry, you said "sometimes". Just noticed that the first case indeed
    doesn't commit. Just thought of another potential source of leaks -
    Cayenne iterated queries. Are you using any of those?
    No, we are not using performIteratedQuery() with postgres.

    Is there another possibility to debug this problem or verify if
    this is maybe a cayenne or jdbc-postgres bug?

    Oilid
  • Oilid Adsi at Apr 26, 2007 at 10:14 am
    Hi again,

    we tried again to fix this problem. So we used exactly the same versions as described by Tore. But one difference comes with the application server. We are only using an Apache Tomcat 5.5.17

    The problem still exists... Sometimes the transactions will be commited sometimes not which results in the "<IDLE> in transaction" problem.

    So we are thinking about to workaround this problem.

    Andrus, is there a possibility by using the "Container-Managed Transactions"-function (http://cayenne.apache.org/doc20/understanding-transactions.html)?

    Or maybe by adding an explicit "COMMIT" after every SELECT-Statement when the connection will be returned to the pool? Can this implemented as an optional function to the Cayenne framework?

    Thanks for help and hints!

    Oilid
    -----Ursprüngliche Nachricht-----
    Von: Tore Halset
    Gesendet: Mittwoch, 25. April 2007 10:08
    An: user@cayenne.apache.org
    Betreff: Re: AW: postgres, idle in transaction

    Hello.

    I am reading this thread and just want to say that I am using cayenne
    2.0.2, postgresql-8.2-504.jdbc3.jar and postgresql-8.2.3. Cayenne
    uses jndi to get connections from a jboss-4.0.3 connection pooling. I
    do not see the "postgres, idle in transaction" problem.

    - Tore.
    On Apr 25, 2007, at 9:45 , Oilid Adsi wrote:

    Hi Andrus,

    Thanks for the patch!

    I have deployed the patch yesterday and switched to cayenne data
    source.

    But unfortunately there is no improvement as you supposed before.

    Is there no way to force this "stupid" COMMIT in a transaction?
    Do you have another idea?

    Kind regards
    Oilid
    -----Ursprüngliche Nachricht-----
    Von: Andrus Adamchik
    Gesendet: Dienstag, 24. April 2007 17:20
    An: user@cayenne.apache.org
    Betreff: Re: postgres, idle in transaction

    I just uploaded a patched 1.2 build with Cayenne connection pool
    rolling back transactions before returning them to the pool. Can you
    try it out (of course resetting DBCP data source back to Cayenne):

    http://people.apache.org/~aadamchik/patched/cayenne-nodeps-1.2.3-
    dev.jar

    I don't have too much hope this will fix it... but still worth a try.

    Andrus

    On Apr 24, 2007, at 5:28 PM, Oilid Adsi wrote:

    -----Ursprüngliche Nachricht-----
    Von: Andrus Adamchik
    Gesendet: Dienstag, 24. April 2007 16:21
    An: user@cayenne.apache.org
    Betreff: Re: AW: postgres, idle in transaction

    On Apr 24, 2007, at 5:17 PM, Andrus Adamchik wrote:

    Interesting... Looking at your log I see this:

    15:33:08.267 (2) FE=> Parse(stmt=S_1,query="BEGIN",oids={})
    .....
    15:33:08.268 (2) FE=> Parse(stmt=null,query="SELECT ....
    ....
    15:33:28.461 (2) FE=> Parse(stmt=S_2,query="COMMIT",oids={})


    So transaction is clearly committed. But of course connection is
    not closed. It is returned to the pool instead. Still looks like a
    driver bug to me.

    Andrus
    Sorry, you said "sometimes". Just noticed that the first case
    indeed
    doesn't commit. Just thought of another potential source of leaks -
    Cayenne iterated queries. Are you using any of those?
    No, we are not using performIteratedQuery() with postgres.

    Is there another possibility to debug this problem or verify if
    this is maybe a cayenne or jdbc-postgres bug?

    Oilid
  • Andrus Adamchik at Apr 26, 2007 at 11:47 am

    On Apr 26, 2007, at 1:14 PM, Oilid Adsi wrote:

    Or maybe by adding an explicit "COMMIT" after every SELECT-
    Statement when the connection will be returned to the pool? Can
    this implemented as an optional function to the Cayenne framework?
    Per your comment the patch doing "rollback" didn't help, why do you
    think "commit" should help? Commit and rollback both terminate a
    transaction.

    http://objectstyle.org/cayenne/lists/cayenne-user/2007/04/0159.html

    But if you want to explore various scenarios, Cayenne allows you to
    plug a custom implementation of DataSource via the DataSourceFactory
    mechanism. So you don't need to patch Cayenne, but instead you can
    write a custom DataSource (based on Cayenne or DBCP library, or do it
    from scratch) to do any pre- or post- processing of connections
    checked in or out of the pool.

    If you get to the cause of it, please share. Unfortunately I am out
    of ideas regarding this issue.

    Andrus

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedApr 24, '07 at 2:28p
activeApr 26, '07 at 11:47a
posts4
users2
websitecayenne.apache.org

2 users in discussion

Oilid Adsi: 2 posts Andrus Adamchik: 2 posts

People

Translate

site design / logo © 2022 Grokbase