Logging.LogDebug("SQLiteCommand executed reader!") Using (SQLiteDataReader reader = mycommand.ExecuteReader()) Logging.LogDebug("SQLiteCommand executing reader.") Sure, dbConnection is the connection string, set by the following function. public SqLiteDatabase(String inputFile)ĭbConnection = String.Format("Data Source=ms", iterations, diffTime.TotalMilliseconds/iterations)) inputFile is just the string path of the filename to open. Having had the same problem, I was looking into this and it seems to be related to permissions on the file or it's parent folders, who created it, and/or how it was created. In my case, the SQLite database file was being created by a script run as a regular user, and then an IIS-hosted service would access the file under a different domain service account.Įvery time the service opened a connection, it took over 1.5 seconds, but otherwise operated correctly (it could eventually access the file). The service worked fine and was able to eventually query the data in the file, albeit slowly.Ī stand-alone program running as the regular user could open a connection to the same file in the same place in a few milliseconds.Īnalysis of a procmon trace revealed that in the case of the service, we were getting several ACCESS DENIED logs on the file over the course of about 1.5 seconds, that were not present in the trace when running as the regular user. When we made the service account the owner of the parent folder of the file, and gave him write permission, the ACCESS DENIED logs disappeared and the service operated at full speed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |