Re: Duplicate entry '4183884' for key 'PRIMARY'

Kieran Kelleher <[email protected]> Fri, 17 May 2013 16:43:49 -0400
Newsgroups gmane.comp.web.webobjects.wonder-disc
Message-ID <[email protected]>
Your problem is MyISAM ....... MyISAM tables are not transactional and as a rule, should never be used with WebObjects. You will suffer forever and destroy the integrity of your data as long as you use MyISAM.

Write a conversion script (I have a rudimentary one somewhere if needed) and do a test conversion to InnoDB on a copy of your database (from a slave or whatever) and create a good InnoDB configuration (https://github.com/kierankelleher/gic-mysql-tools). test your app. Then once satisfied, convert your live db to InnoDB.

On May 17, 2013, at 2:04 PM, Mark Gowdy <[email protected]> wrote:

> Hi, 
> 
> We have started getting more of these errors recently, now that the system is under a bit more load.
> 
> ----
> EvaluateExpression failed: <com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: "INSERT INTO queue_item(ITEM_DATE,  ...  etc....)
> Duplicate entry '4183884' for key 'PRIMARY'
> ----
> 
> I believe the problem is due to the fact that there is more than one instance trying to write to the 'queue_item' table, and the EO_PK_TABLE mechanism is handing out the same ID more than once.
> Probably something to do with locking.
> 
> Our Database is MySQL, and the EO_PK_TABLE is of type MyISAM.
> 
> I tried to find the mechanism that allocate the primary key, but I keep bumping up against:
> 
> EOAdaptorChannel:
> 	@Deprecated
> 	public NSDictionary<String, Object> primaryKeyForNewRowWithEntity(EOEntity entity){
> 		return null;
> 	}
> 
> 
> Any advise would be appreciated, 
> 
> Thanks, 
> 
> Mark
> 
> 
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> Wonder-disc mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wonder-disc


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d