title: When does Cascade Delete Commit in Sqlite?
body: <p>This is my sql set of statements:</p>
  
  <pre><code>char *sql = "BEGIN TRANSACTION;
  CREATE TABLE Friends(id varchar UNIQUE); 
  CREATE TABLE Enemies(id2 varchar ,id3 INTEGER,CONSTRAINT id_econst
  FOREIGN KEY(id2) REFERENCES Friends(id) ON DELETE CASCADE);
  INSERT INTO Friends VALUES('11');
  INSERT INTO Friends VALUES('2');
  INSERT INTO Enemies VALUES('11',3);
  INSERT INTO Enemies VALUES('3',5);
  END TRANSACTION;
  PRAGMA foreign_keys = ON;
  DELETE FROM Friends WHERE id = '11';";
  </code></pre>
  
  <p>Performs cascade delete on the Enemies table, whereas :</p>
  
  <pre><code> char *sql = "BEGIN TRANSACTION;
  CREATE TABLE Friends(id varchar UNIQUE); 
  CREATE TABLE Enemies(id2 varchar ,id3 INTEGER,CONSTRAINT id_econst
  FOREIGN KEY(id2) REFERENCES Friends(id) ON DELETE CASCADE);
  INSERT INTO Friends VALUES('11');
  INSERT INTO Friends VALUES('2');
  INSERT INTO Enemies VALUES('11',3);
  INSERT INTO Enemies VALUES('3',5);
  PRAGMA foreign_keys = ON;
  DELETE FROM Friends WHERE id = '11';
  END TRANSACTION;";
  </code></pre>
  
  <p>does normal delete.</p>
  
  <p>Why is it so ?</p>