System.Data.SQLite
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: 1.0.94.0
User Comments:
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