1 Reply Latest reply on Jun 4, 2009 9:54 AM by tedalde2

    SQLite transaction problems

    de5a1n7

      Hi,

      Does anyone know how to use sqlite transaction in AIR?   

      I tried the following codes but received an error saying that sql.execute() cannot be called because the executing is still true.

      This happen for the second insert, the first 1 is ok.

       

                      _conn.begin();
                      sql.sqlConnection = _conn;
                     
                      sql.addEventListener(SQLEvent.RESULT, resultHandler);
                      sql.addEventListener(SQLErrorEvent.ERROR, errorHandler);
                      sql.text = statement;
                      if(parameters != null)
                      {
                          for(var i:int = 0; i < parameters.length; i++)
                          {
                              for(var j:int = 0; j < parameters[i].length; j++)
                              {
                                  sql.parameters[parameters[i][j].name] = parameters[i][j].value;
                              }
                              sql.execute();
                          }
                      }
                      sql.sqlConnection.commit();

       

      Thank you...