• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: PK Generation in MySQL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: PK Generation in MySQL


  • Subject: RE: PK Generation in MySQL
  • From: "Randy Wigginton" <email@hidden>
  • Date: Thu, 18 May 2006 14:35:49 -0400

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: webobjects-dev-bounces+cawineguy=email@hidden [mailto:webobjects-dev-bounces+cawineguy=email@hidden] 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

email@hidden

 



 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: PK Generation in MySQL
      • From: Robert Walker <email@hidden>
References: 
 >Re: PK Generation in MySQL (From: Robert Walker <email@hidden>)

  • Prev by Date: Re: PK Generation in MySQL
  • Next by Date: DB connection failing.
  • Previous by thread: Re: PK Generation in MySQL
  • Next by thread: Re: PK Generation in MySQL
  • Index(es):
    • Date
    • Thread