• 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: Bad eodelegate method?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bad eodelegate method?


  • Subject: Re: Bad eodelegate method?
  • From: Randy Wigginton <email@hidden>
  • Date: Tue, 11 Jul 2006 13:31:42 -0400

You are indeed correct.  I changed it back to what it should be, which is:
NSArray rawRows = EOUtilities.rawRowsForSQL(ec, "api",  "UPDATE EO_PK_TABLE SET pk=LAST_INSERT_ID(pk+1) where lower(name)='"+entity.externalName().toLowerCase()+"'");
rawRows = EOUtilities.rawRowsForSQL(ec, "api",  "select last_insert_id()", keys);
NSDictionary foo = (NSDictionary)rawRows.get(0);
BigDecimal bd = (BigDecimal)foo.valueForKey("pk");

This is safe across multiple instances.  I had changed the SQL when trying to figure out what the #$%#% was going on.


On Jul 11, 2006, at 1:11 PM, Chuck Hill wrote:
PS - The delegate method is actually inside a synchronized() block -- I had to remove that in order to get the message down to a size that the list would contain it.

That will be OK unless you plan on running multiple instances.  In that case you still have a race condition at the database level.

Chuck

-- 
Coming sometime... - an introduction to web applications using WebObjects and Xcode     http://www.global-village.net/wointro

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.    http://www.global-village.net/products/practical_webobjects





 _______________________________________________
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

References: 
 >Bad eodelegate method? (From: Randy Wigginton <email@hidden>)
 >Re: Bad eodelegate method? (From: Chuck Hill <email@hidden>)
 >Re: Bad eodelegate method? (From: Randy Wigginton <email@hidden>)
 >Re: Bad eodelegate method? (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: WWDC WO Meet
  • Next by Date: Re: webobjects 5.3 and windows
  • Previous by thread: Re: Bad eodelegate method?
  • Next by thread: Adding EOModels embedded in an external framework to an existing project
  • Index(es):
    • Date
    • Thread