cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Mittendorf <christian.mittend...@freenet.de>
Subject Re: Duplicate Key Problem
Date Wed, 12 Jul 2006 17:50:03 GMT
We don't use the autoincrement from MySQL.

Am 12.07.2006 um 16:35 schrieb Gentry, Michael ((Contractor)):

> Are you using MySQL's autoincrement feature for the PKs or the
> auto_pk_support table from Cayenne?
>
> -----Original Message-----
> From: Christian Mittendorf [mailto:christian.mittendorf@freenet.de]
> Sent: Wednesday, July 12, 2006 4:29 AM
> To: cayenne-user@incubator.apache.org
> Subject: Duplicate Key Problem
>
>
> Hello!
>
> We are running a MySQL 5.0 server using InnoDB tables for our
> applications. We have multiple web applications accessing this same
> database and the system is running smooth and without problems  
> (almost).
>
> But yesterday we were experiencing some strange errors. During the
> afternoon some CayenneRuntimeExceptions appeared in the log file,
> which were caused by:
>
> Caused by: java.sql.SQLException: null,  message from server:
> "Duplicate entry '4353880' for key 1"
>
> A bit later other CayenneRuntimeException appeared. For those
> exceptions the cause was:
>
> Caused by: java.sql.SQLException: Deadlock found when trying to get
> lock; Try restarting transaction,  message from server: "Lock wait
> timeout exceeded; try restarting transaction"
>
> I'm now wondering, are both errors related to each other?
>
> There are, from my point of view, two possible causes for the
> "Duplicate entry..." message:
>
> - two Insert statements on the same object, which might be possible
> if the application is clustered, which our applications are not, or
> - dual use of the same key in different objects
>
> Has anybody else experienced something like that? Are there any hints
> what I might do to avoid such situations?
>
> Christian
>
>
>
>


Mime
View raw message