Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8671849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:03:20+00:00 2026-06-12T19:03:20+00:00

I have an iOS app that pulls user data down from a web service

  • 0

I have an iOS app that pulls user data down from a web service and saves it to a sqlite backed core data store. While this is also going on I’m taking the url for the user’s avatar and saving the image locally into core data as the download of each image becomes available.

Each of these are performed on their own thread with their own managed object context but with the same shared persistent store coordinator.

When there are just a few items being pulled down, this works great, but as we approach 100 items or so I get frequent deadlocks on the initial load of data. When I pause the debugger I see the different threads usually both waiting on an executeFetchRequest.

I turned on the sql debug in my scheme and according to the console output the fetches complete, but the threads never continue.

What else can I use or look at to examine why these are deadlocking or how I can prevent these deadlocks from occurring?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:03:21+00:00Added an answer on June 12, 2026 at 7:03 pm

    Make sure that you batch changes to the DB together. No need to call saveContext after each change. Instead it is probably sufficient to save in the temporary background context after every dozen or so changes.

    Please see this article of mine on some pointers: http://www.cocoanetics.com/2012/07/multi-context-coredata/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iOS app that displays content from a sqlite db in a
I have been working on a Core Data iOS app that works perfectly through
I have an iOS app that stores some data in a sqlite database. The
I have an iOS app that uses a SQLite DB to store its data
I have a Rails web app that is used to gather data from an
I have an iOS app that gets all the videos from a user through
In my iOS app I have several UIElement s that can process user input:
I have an iOS app sending requests to a PHP based web service ,
I have an iOS 5 App that consumes webservices from a Rails 3 server.
I have an iOS app that contains a lot of local web content. Some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.