• 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
NSManagedObjectContext import issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSManagedObjectContext import issue


  • Subject: NSManagedObjectContext import issue
  • From: "Marcus S. Zarra" <email@hidden>
  • Date: Tue, 7 Feb 2006 20:06:07 -0700

I am running into a very strange issue. I am attempting to import a large amount of data into a sqlite data store. In the application I spin off a separate thread and create the managed object context in the secondary thread. It uses its own persistent store and there are no other stores attached.

In this separate thread I have broken apart a csv file into an array of lines. I then loop through that array of lines and create managed objects -- 1-3 managed objects per line. Every x lines I have tried variations of the following:

flush the autorelease pool
save the context
reset the managed object context

If I only flush the pool, the memory gets out of control very quickly.

If I save the context, I eventually get an error:

AppKitJava: uncaught exception NSInternalInconsistencyException (+entityForName: could not locate an NSManagedObjectModel)
AppKitJava: exception = +entityForName: could not locate an NSManagedObjectModel
AppKitJava: terminating.


If I reset the context without saving, the data is thrown away.

If I do all three I get the error listed above.

My questions:

1. Has anyone run across this error before? Note that the context is not nil as I create it in this thread.
2. The application is written in Objective-C and while Java is used in another portion of the application it is not used in this thread or in this import.
3. According to Apple's Documentaiton reset on the context is supposed to reduce memory consumption but it does not seem to. What is the best way to keep memory under control while importing a large (5,000+) amount of data.


Thanks for any suggestions or ideas!

Marcus

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSManagedObjectContext import issue
      • From: Brett Powley <email@hidden>
  • Prev by Date: Re: a c question
  • Next by Date: Re: NSManagedObjectContext import issue
  • Previous by thread: [Moderator] Cocoa and list resources
  • Next by thread: Re: NSManagedObjectContext import issue
  • Index(es):
    • Date
    • Thread