title: FMDB - Failed to modify DB from Cocoa
body: <p>I am working on a Cocoa application which talks to a local SQLite database with FMDB. I ran into an issue that I can't do any insert or update operation on DB. Select queries run perfectly fine, so I would assume my db connection settings are correct.</p>
  
  <p>The structure of my code is basically like this:</p>
  
  <pre><code>FMDatabase* db=[FMDatabase databaseWithPath:[[NSBundle mainBundle] pathForResource:@"DBName" ofType:@"sqlite"]];
  
  if(![db open])
  {
    NSLog(@"Could not open db.");
  }
  
  db.traceExecution=YES;
  [db beginTransation];
  [db ExecuteUpdate:"INSERT INTO test (title) VALUES(?)", [NSNumber numberWithInt]:2],nil];
  [db commit];
  [db close];
  </code></pre>
  
  <p>No exceptions or warnings were thrown during execution, the console output regarding db.traceExecution is like following:</p>
  
  <pre><code>&lt;FMDatabase: 0x100511fd0&gt; executeUpdate: BEGIN EXCLUSIVE TRANSACTION;
  &lt;FMDatabase: 0x100511fd0&gt; executeUpdate: INSERT INTO test (title) VALUES(?);
  obj: 2
  &lt;FMDatabase: 0x100511fd0&gt; executeUpdate: COMMIT TRANSACTION;
  </code></pre>
  
  <p>The testing database is simply just a one column table of INT type.</p>
  
  <p>Everything looks fine except that the db file is not updated at all. It's really confusing to me as the Select query works perfectly fine. I checked the path of the database, it is pointing to the right one. First I suspect it's caused by file permission, but the issue remain the same even if I allowed everyone to be able to read/write.</p>
  
  <p>I have been stucked with this problems for many hours and couldn't find a proper solution. Can anyone shed some light on this? Thanks!</p>