• 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: Session EC Exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Session EC Exception


  • Subject: Re: Session EC Exception
  • From: Amedeo Mantica <email@hidden>
  • Date: Thu, 21 Apr 2011 13:27:43 +0200



On 21/apr/2011, at 10.14, Philippe Rabier wrote:

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).

+1

you could also try to fix it directly with SQL in database, is a to-one relationship so you have just to update the id  ( a search/replace )

update TABLE_NAME set FIELD_NAME = NEW_ID where FIELD_NAME  = OLD_ID;

DO A BACKUP FIRST !
you could also create a new column in the database and copy all relationships IDs before touching it, so you have a quick restorable backup (remember to allow null values, otherwise you will get in error adding a new row)

Regards
Amedeo


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
  • Follow-Ups:
    • Re: Session EC Exception
      • From: Ken - Watermark Studios <email@hidden>
References: 
 >Session EC Exception (From: Ken - Watermark Studios <email@hidden>)
 >Re: Session EC Exception (From: Philippe Rabier <email@hidden>)

  • Prev by Date: isEntityDeletable being cached in D2WContext in ERMODListPage
  • Next by Date: Session id generation - how is it done?
  • Previous by thread: Re: Session EC Exception
  • Next by thread: Re: Session EC Exception
  • Index(es):
    • Date
    • Thread