title: Core Data SQLite Constraint Failed
body: <p>I sometimes get an error when I attempt to save a managed object context backed by SQLite.</p>
  
  <pre><code>Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)" UserInfo=0x280170 {NSFilePath=/var/mobile/Applications/7773BDBD-C502-4E21-9632-FA36A109BF6E/Documents/Social.sqlite, NSUnderlyingException=error during SQL execution : constraint failed}, { NSFilePath = "/var/mobile/Applications/7773BDBD-C502-4E21-9632-FA36A109BF6E/Documents/Social.sqlite";
  NSUnderlyingException = "error during SQL execution : constraint failed";  
  } 
  </code></pre>
  
  <p>This does not happen with a binary datastore, and only happens when I modify a particular entity and save the context multiple times in a short period. Can anyone suggest a way to debug this? I've looked at the .sqlite file with sqlite3, and nothings jumps out. I don't think that it's an explicit core data constraint violation (null required value or the like) because I see no error with the binary store. The program is complex (multiple contexts in several threads), and I've not been able to duplicate the error in simple code to show here. Any ideas about how to get logging out of the sqlite instance behind core data?</p>