title: Database is locked error in sqlite
body: <p>I am using sqlite database for store my data.But it is showing error of "database is locked" while insert query.Here is my code</p>
  
  <pre><code> sqlite3_stmt    *statement;
          NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
          const char *dbpath = [[defaults objectForKey:@"dbpath"] UTF8String];
  
          if (sqlite3_open(dbpath, &amp;studentDB22) == SQLITE_OK)
          {
              NSString *insertSQL = [NSString stringWithFormat:@"INSERT INTO Emotion_videos (name) VALUES (\"%@\")",filePath];
              const char *query_stmt = [insertSQL UTF8String];
                  if (sqlite3_prepare_v2(studentDB22, query_stmt, -1, &amp;statement, NULL) == SQLITE_OK)
                  {
                      NSLog(@"shi h2345");
                      if (sqlite3_step(statement) == SQLITE_ROW)
                      {
                          printf( "could not prepare statement: %s\n", sqlite3_errmsg(studentDB22));
  
                      }
  
                  }
              sqlite3_finalize(statement);
          }
          else
          {
                     printf( "could not prepare statement: %s\n", sqlite3_errmsg(studentDB22));
          }
  </code></pre>
  
  <p>I am able to insert data for two or three times but when it runs again,it shows database locked error.</p>