SQLiteDump.Restore extremly slow
Posted: Sun 13 Mar 2011 12:19
I use the SQLiteDump.Restore method to restore my sqlite db. First I read in the backupscript into an streamreader, then call Restore (in an transaction). The backupscript includes ca 5000 insert statements to diffrent tables. But the operation is very,very slow. 10-15 minutes. Is there any other solution to backup and restore an sqlite database?
My code:
My code:
Code: Select all
var streamReader = new StreamReader(pRestoreFilePath, Encoding.UTF8);
if (mSqLiteConnection.State != ConnectionState.Open)
mSqLiteConnection.Open();
var sqSqlDump = new SQLiteDump {Connection = mSqLiteConnection};
SQLiteTransaction transaction = mSqLiteConnection.BeginTransaction(IsolationLevel.ReadCommitted);
sqSqlDump.Restore(streamReader);
transaction.Commit();