RE: Duplicate Key Problem

From: Gentry, Michael \(Contractor\) ("Gentry,)
Date: Fri Jul 21 2006 - 10:14:19 EDT

  • Next message: Christian Mittendorf: "Re: Duplicate Key Problem"

    I was never able to reproduce the problem, either. I have version
    4.0.12 of MySQL. I think autoReconnect=false is a good thing to try,
    since Cayenne will catch connection exceptions and try to reconnect on
    its own.

    Thanks,

    /dev/mrg

    -----Original Message-----
    From: Christian Mittendorf [mailto:christian.mittendor..reenet.de]
    Sent: Friday, July 21, 2006 9:56 AM
    To: cayenne-use..ncubator.apache.org
    Subject: Re: Duplicate Key Problem

    Am 13.07.2006 um 20:35 schrieb Andrus Adamchik:

    > BTW, I tried to reproduce PK generator getting an incorrect PK
    > range on MySQL by emulating some load via JMeter. It never happens
    > (at least on a single VM instance). I wrote a test case that throws
    > an exception randomly on committing the user transaction. Still the
    > application was able to recover from failed transactions and carry
    > on processing other requests.

    May it be that the version of MySQL has some affects on what we
    experience? We are currently using 5.0.18.

    > I am curious what Michael finds in his tests.

    Me too, are there any results available?

    > Anyways, I went ahead and added an explicit commit to the PK
    > generator (that code, although I couldn't make it fail, still
    > looked suspect) and posted new jars here:
    >
    > http://dev.objectstyle.org/~andrus/cayenne-07132006/
    >
    > Christian, I would appreciate if you could try this in your
    > application and see if you still get those errors.

    We will update some applications in the next week, we haven't found
    the time to do so this week.

    But there was some other idea we had discussed recently. At the
    moment all of our apps use the "autoReconnect=true" feature of the
    jdbc driver and after some discussions with colleagues we updated the
    config to use "autoReconnect=false". If our problem is related to
    MySQL loosing the connection I would expect to get some kind of "Lost
    connection" errors instead of duplicate key messages.

    Christian



    This archive was generated by hypermail 2.0.0 : Fri Jul 21 2006 - 10:14:45 EDT