Hello all,
  We were previously using 1.0.79.0, but in an attempt to move to VS2012 /
.NET 4.5 I started doing some testing with 1.0.83.0.  I found that many of
our UnitTests now fail when they try to delete the temporary test database
file they created.  This happens with the SQLiteConnection() call.  I can
provide a complete VS project, but here's a code snippet that has the
crucial parts:

            const string TmpDatabase = @"c:\tmp\Test_SQLConnection.db";
            var connectionString = string.Format("Data
Source={0};Pooling=false;FailIfMissing=true;", TmpDatabase);

            using (var connection = new SQLiteConnection(connectionString))
            {
                connection.Open();

                var sqlCommand = new SQLiteCommand(connection)
                {
                    CommandText = "SELECT * from User where
Username='administrator'"
                };

                using (var reader = sqlCommand.ExecuteReader())
                {
                    if (!reader.Read())
                    {
                        throw new InvalidDataException("Unable to read
data");
                    }

                    Assert.AreEqual(reader["FirstName"], "admin", "Database
Mismatch - expected 'admin'");
                }
            }

            File.Delete(TmpDatabase);

Simply changing the System.Data.SQLite.DLL from the 1.0.79.0 version to the
1.0.83.0 version causes the "File.Delete()" to fail with:
  System.IO.IOException: The process cannot access the file
'c:\tmp\Test_SQLConnection.db' because it is being used by another process.

I would appreciate any info on this change.  Thanks very much.


--
Michael Russell
MTI Film, LLC
michael.russ...@mtifilm.com
http://www.mtifilm.com/
Providence, RI 02906 USA
+1 (401) 831-1315
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to