title: Thousands of ORMLite raw inserts taking several minutes on Android
body: <p>I'm trying to pre-populate an Android SQLite database using ORMLite. The problem is that this operation is too slow. It takes several minutes. The code below show how it happens. </p>
  
  <pre><code>    RuntimeExceptionDao&lt;Company, Integer&gt; companyDao = ORMLiteHelper.getInstance(context).getCompanyRuntimeDao();AssetManager am = context.getAssets();
  
      try {
          InputStream instream = am.open("companies.sqlite");
          if (instream != null) {
              InputStreamReader inputreader = new InputStreamReader(instream);
              BufferedReader buffreader = new BufferedReader(inputreader);
  
              String line;
              try {
                  while ((line = buffreader.readLine()) != null) {
                      //Log.i("SQL", line);                       
                      if (line.startsWith("INSERT INTO Companies")) {
                          companyDao.executeRaw(line);
                      } 
  
                  }
              } catch (Exception e) {
                  Log.i("SQL", e.getMessage() + " " + e.getLocalizedMessage());
              }
          }
      } catch (Exception e) {
          Log.i("SQL", e.getMessage());
      }
  </code></pre>
  
  <p>Where companies.sqlite is a file with tousands of lines of inserts like this:</p>
  
  <pre><code>INSERT INTO Companies (id, name) VALUES (1, 'Duff Beer');
  </code></pre>
  
  <p>I'm using a DatabaseConfigUtil class to avoid the use of annotations.</p>