Originally created by @Conrad-m-wise on GitHub (Apr 14, 2016).
I have this launch option set for my development scheme "-com.apple.CoreData.ConcurrencyDebug 1" to catch core data multi threading violations.
I am trying to create an object from a beginAsynchronous block but the app crashes
dataStack.beginAsynchronous { (transaction) in
Delete any saved message with same id
let int = transaction.deleteAll(From(ManagedUserMessage), Where("messageID", isEqualTo:message.messageID))
if int > 0{
log.debug("Did delete user message with ID:\(message.messageID)")
}
//Create new message
let managedMessage = transaction.create(Into(ManagedUserMessage))
}
if i remove the launch option it does not fail.
Originally created by @Conrad-m-wise on GitHub (Apr 14, 2016).
I have this launch option set for my development scheme "-com.apple.CoreData.ConcurrencyDebug 1" to catch core data multi threading violations.
I am trying to create an object from a beginAsynchronous block but the app crashes
dataStack.beginAsynchronous { (transaction) in
```
Delete any saved message with same id
let int = transaction.deleteAll(From(ManagedUserMessage), Where("messageID", isEqualTo:message.messageID))
if int > 0{
log.debug("Did delete user message with ID:\(message.messageID)")
}
//Create new message
let managedMessage = transaction.create(Into(ManagedUserMessage))
```
}
if i remove the launch option it does not fail.
adam
added the wontfix label 2025-12-29 15:23:06 +01:00
The com.apple.CoreData.ConcurrencyDebug flag lets Core Data tell you when the managed context is accessed from any queue other than its own, which includes CoreStore's transactions' queues (beginAsynchronous(), etc).
CoreStore already guarantees safety for you by making the Main Context read-only, and by only allowing updates to be made within transactions. You should be safe even without the ConcurrencyDebug flag (as long as you don't do hacky things).
Let me know if you need any clarifications :)
@JohnEstropia commented on GitHub (Apr 14, 2016):
@Conrad-m-wise Hi, this is a duplicate of https://github.com/JohnEstropia/CoreStore/issues/28.
As I mentioned on that thread,
> The `com.apple.CoreData.ConcurrencyDebug` flag lets Core Data tell you when the managed context is accessed from any queue other than its own, which includes CoreStore's transactions' queues (`beginAsynchronous()`, etc).
>
> CoreStore already guarantees safety for you by making the Main Context read-only, and by only allowing updates to be made within transactions. You should be safe even without the ConcurrencyDebug flag (as long as you don't do hacky things).
Let me know if you need any clarifications :)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @Conrad-m-wise on GitHub (Apr 14, 2016).
I have this launch option set for my development scheme "-com.apple.CoreData.ConcurrencyDebug 1" to catch core data multi threading violations.
I am trying to create an object from a beginAsynchronous block but the app crashes
dataStack.beginAsynchronous { (transaction) in
}
if i remove the launch option it does not fail.
@JohnEstropia commented on GitHub (Apr 14, 2016):
@Conrad-m-wise Hi, this is a duplicate of https://github.com/JohnEstropia/CoreStore/issues/28.
As I mentioned on that thread,
Let me know if you need any clarifications :)