Re: Bad eodelegate method?
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
--
|
_______________________________________________
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