View Ticket
Not logged in
Ticket UUID: d6b070c5d7d05f92f23929a0b73c17a2fddd24a2
Title: disposing of the connection/reader with EF 6
Status: Closed Type: Incident
Severity: Severe Priority: Medium
Subsystem: LINQ Resolution: External_Bug
Last Modified: 2015-03-04 19:22:08
Version Found In:
User Comments:
anonymous added on 2015-02-11 11:18:09:

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.



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: