title: "sqlite3_exec(database, "COMMIT", NULL, NULL, &errmsg)" statement works on 5.1 and 6.1 simulator, but not on iPhone 4 device
body: <p>I'm newbie.  I didn't think I was the only one with this issue, but all the other problems I viewed didn't seem to cover this particular issue.  I'm just trying to update a table in sqlite see below code.  This code works in both 5.1 and 6.1 simulators, but when I run it on my device (iPhone 4 - iOS 6.1), the "<code>sqlite3_exec(database, "COMMIT", NULL, NULL, &amp;errmsg);</code>" statement (fifth statement from the bottom) fails the error "if" statement (fourth statement from the bottom and gives me "Error while updating. cannot commit - no transaction is active" NLog statement (third statement from the bottom).  If someone can advise me as to what I am doing wrong I would be very much appreciative.  Thanks in advance.  </p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"Cell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
      }
      int rowCount = indexPath.row;
      Game *game = [self.thegames objectAtIndex:rowCount];
      cell.textLabel.text = game.GameDate;
  
  
      NSString* str3=[game.GameDate substringToIndex:4];
  
      NSString * Selected = [NSString stringWithFormat:@"%@%@", @"You Selected Game - ", str3];
      displayLabel.text = Selected;
  
  
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentsPath = [paths objectAtIndex:0];
      NSString *filePath = [documentsPath stringByAppendingPathComponent:@"sportretortdatab2.sqlite"];
  
      NSString* str1 = displayLabel.text;
      NSString *str2 = [str1 substringFromIndex: [str1 length] - 4];
  
      sqlite3 *database;
      sqlite3_stmt *updateStmt;
             if(sqlite3_open([filePath UTF8String], &amp;database) == SQLITE_OK)    
      {
          NSString* sql= [NSString stringWithFormat:@"UPDATE ArchievedGameDate Set GameDate = \"%@\"", str2];
  
  
          if(sqlite3_prepare(db, [sql cStringUsingEncoding:NSASCIIStringEncoding], -1, &amp;updateStmt, NULL) != SQLITE_OK)
              NSLog(@"Error while creating update statement. %s", sqlite3_errmsg(database));
      }
      char* errmsg;
      sqlite3_exec(database, "COMMIT", NULL, NULL, &amp;errmsg);
  
      if(SQLITE_DONE != sqlite3_step(updateStmt))
          NSLog(@"Error while updating. %s", sqlite3_errmsg(database));
      sqlite3_finalize(updateStmt);
      sqlite3_close(database);
      }
  </code></pre>