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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to