cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gentry, Michael \(Contractor\)" <>
Subject RE: Duplicate Key Problem
Date Wed, 12 Jul 2006 17:56:23 GMT
These could be related, then.  I know the MySQL adapter has to lock the
auto_pk_support table to generate keys and perhaps something happened to
leave the table locked.  Did you see any other exceptions?

Also, you said you have multiple applications hitting the same database.
Are all of these applications Cayenne-based?



-----Original Message-----
From: Christian Mittendorf [] 
Sent: Wednesday, July 12, 2006 1:50 PM
Subject: Re: Duplicate Key Problem

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 []
> Sent: Wednesday, July 12, 2006 4:29 AM
> To:
> 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

View raw message