OK, I may have solved my own problem, but I don't understand the solution.
I changed the code to have the following structure:
using (DbConnection connection = new SQLiteConnection(SQLiteConnectionString(false)))
{
using (TransactionScope transaction = new TransactionScope())
{
connection.Open();
using (IDbCommand command = connection.CreateCommand())
{
// Set command.CommandText
// Create and add the parameters
foreach (string line in lines)
{
// Set the parameter's value
command.ExecuteNonQuery();
}
}
connection.Open();
transaction.Complete();
}
}
I had seen references to this structure earlier but I had also come across this post which seemed to imply that creating the connection before the TransactionScope was no longer necessary.
http://sqlite.phxsoftware.com/forums/p/482/2044.aspx#2044
Also, this only seemed to be a problem with my larger data sets, smaller ones didn't matter.
Does anyone have an explanation for what I have observed?
Oh, and I forgot to mention I am using v1.0.65.0.
Thanks,
-Mont