|Title:||disposing of the connection/reader with EF 6|
|Last Modified:||2015-03-04 19:22:08|
|Version Found In:||18.104.22.168|
anonymous added on 2015-02-11 11:18:09:
Hello, there is a problem in using sqlite with entity framework. After reading from the database, the database file cannot be removed, because the process still has handles on that file. There is a workaround - calling garbage collection, but in some cases this solution is unusable. I suppose the problem is with some inproperly disposed object. I created a simple sample project that demonstrates the issue. http://1drv.ms/1yezOzk Regards, Miro
mistachkin added on 2015-02-11 18:41:21:
Is it possible that the Entity Framework itself is holding onto IDisposable resources belonging to System.Data.SQLite? If so, is there some way to force Entity Framework to close/release them?
mistachkin added on 2015-02-11 18:42:58:
Also, it might be worthwhile to try reproducing this issue with the latest pre-release code.
mistachkin added on 2015-02-11 21:08:43:
I was able to reproduce the issue locally. It appears to be caused by the Entity Framework holding onto System.Data.SQLite resources, even after the Entity Framework resources themselves have been disposed. Also, please see the following email thread for more information: https://www.mail-archive.com/sqlite-users%40sqlite.org/msg74673.html