Thanks.  The issue is not MySQL speed.  I’m extremely happy with the performance of MySQL.  I am gathering information from a webservice; thus, it is the gating operation.  If I have two separate threads querying the webservice, I get the results twice as fast.  During all of this my load goes up to maybe.. 0.03

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Walker
Sent: Thursday, May 18, 2006 2:24 PM
To: Development WebObjects
Subject: Re: PK Generation in MySQL

 

Randy,

 

Generally PK generation is a function EOF not MySQL.  There are plug-ins that support database native PK generation, as is the case with "OpenBasePKPlugIn." but I'm not aware of anything similar for MySQL.

 

In any case, unless you're using something special, this problem likely has nothing to do with MySQL.  The problem would exist no matter what data store is used.

 

This may have something to do with the batched PK generation used by EOF, or improper use of locking on your EOEditingContexts.

 

Is it absolutely necessary to multi-thread your inserts?  If you're expecting better performance from MySQL, I don't think you'll get what you expect.  MySQL will just queue up the inserts and do them in sequence anyway.  At least this is my experience with MySQL.  In fact we had to go to OpenBase for a project just because MySQL insert/update performance was abysmal.  OpenBase performed at least 10x faster than MySQL on insert/update.

 

Also, it's my understanding that EOF is not threaded anyway.  Could be wrong on this point.

 

On May 18, 2006, at 1:50 PM, Randy Wigginton wrote:



This seems like a surprisingly obvious bug, so I figured I’d better ask what I’m doing wrong.

 

I have some code that writes records to a MySQL DB.  The PK is a simple INT, and the field is the only one the record locks on.  Everything works fine in a single thread… but when I start a second thread writing to the table, sooner or later one thread gets a “duplicate entry ‘187451’ for key 1.”

 

Do I need to do something special for MySQL to get PK generation working correctly?

--

Robert Walker

 



 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to