EOF can't update a user because it's likely that the same user has been updated by another instance between the moment where the user has been fetched and the moment where is's saved. You should see that if you set EOAdaptorDebugEnabled to true (log4j.logger.er.transaction.adaptor.EOAdaptorDebugEnabled=DEBUG).
First don't call editingContex.save() at the end of the merge but in your loop, for example every ten users modified. The very crap but quickest way to solve : relaunch your app and merge again (it's very dirty, I know).
Better way: use ERXFetchSpecificationBatchIterator. You don't waste memory usage and if the batch size is small, statistically, the problem will raise less often. And you have to deal with this exception, aka invalidate the user. If you have an instance dedicated to the merge, you won't have any issue otherwise it can be tricky if the same object is modified in another editing context, the modifications are lost (read Practical WO again and again).
The best solution is to avoid the problem during record imports, isn't it?
Philippe On 21 avr. 2011, at 04:39, Ken - Watermark Studios wrote: So, I have over 4000 user objects related to about 20 country objects. I had a few duplicate countries in the country table because of record imports. So, I wrote a quick direct action that allows me to merge the countries. Basically, there are two drop-down lists, each with the full country list (including duplicates). I can select two different country objects and the page moves all users of the first selected country to the second selected country.
Here's the problem. I've been successful merging almost every country to the appropriate country. The successful merges have had between 1-500 user objects to move. When I was trying to move USA related users to United States, 900 records successfully move, but I get the following error for over 200 records.
"er.transaction.adaptor.Exceptions - Database Exception occured: com.webobjects.eoaccess.EOGeneralAdaptorException: updateValuesInRowDescribedByQualifier -- com.webobjects.jdbcadaptor.JDBCChannel method failed to update row in database updateValuesInRowDescribedByQualifier -- com.webobjects.jdbcadaptor.JDBCChannel method failed to update row in database"
Where should I start looking to resolve? I've compared the data from objects that successfully transferred against those that didn't transfer and I'm not seeing a clear pattern.
Thanks,
Ken
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
|