I'm facing a odd problem during an insert operation on SQLite. My program is based on Quartz.net and SQLite to make statistics at scheduled times.
But during the insert operations the thread is stopped without error excepted an ThreadAbortException exception. I tried to identify the problem with debug mode but the exception is thrown anywhere in the below method.
Code: Select all
public void ExecuteNonQuery(DbQuery[] queries)
{
using (SQLiteConnection connexion = new SQLiteConnection("Data Source=" + absolutepath))
{
connexion.Open();
using (SQLiteTransaction dbTrans = connexion.BeginTransaction(System.Data.IsolationLevel.ReadCommitted))
{
try
{
foreach (DbQuery query in queries)
{
SQLiteCommand mycommand = connexion.CreateCommand();
mycommand.Connection = connexion;
mycommand.Transaction = dbTrans;
mycommand.CommandText = query.sql;
mycommand = this.InjectParameters(query.parameters, mycommand);
mycommand.ExecuteNonQuery();
}
dbTrans.Commit();
}
catch (Exception exc)
{
dbTrans.Rollback();
}
finally
{
connexion.Close();
}
}
}
}