System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation

Artifact 3021e258a7fa610934535efcfc4e7e3eec001b12:

Ticket change [3021e258a7] - New ticket [165af4c68c] System.Data.SQLite.EF6 has lock on file after DbContext.Dispose(). by anonymous 2020-03-17 20:36:42.
D 2020-03-17T20:36:42.177
J foundin 1.0.112
J icomment Trying\sto\sdelete\sthe\sfile\safter\sperforming\smy\sunit\stest\sfailed.\sIt\sfailed\sbecause\sthe\sfile\sis\sstill\sopen\sused.\r\n\r\nSystem.IO.IOException\s:\sThe\sprocess\scannot\saccess\sthe\sfile\s'D:\\ALAIN\\GitHub\\RPLV\\DataAccessLayerTests\\bin\\Debug\\test.sqlite'\sbecause\sit\sis\sbeing\sused\sby\sanother\sprocess.\r\n\r\nFollowing\sis\sthe\scode\sI\sused\sto\sreproduce\sthe\sproblem.\r\n\s\s\s\s\s\s\s\s[Fact]\r\n\s\s\s\s\s\s\s\spublic\svoid\sOpen_close_with_Context()\r\n\s\s\s\s\s\s\s\s{\r\n\r\n\s\s\s\s\s\s\s\s\s\s\s\s//---\sSetup\r\n\s\s\s\s\s\s\s\s\s\s\s\sSQLiteConnection\sconnection\s=\sRplvContextFactory.Instance.CreateConnection($"Data\sSource={_testFile}")\sas\sSQLiteConnection;\r\n\s\s\s\s\s\s\s\s\s\s\s\sRplvContext\scontextTest\s=\snew\sRplvContext(connection,\strue);\r\n\s\s\s\s\s\s\s\s\s\s\s\scontextTest.Database.Connection.Should().BeSameAs(connection);\r\n\r\n\s\s\s\s\s\s\s\s\s\s\s\s//---\sAction\r\n\s\s\s\s\s\s\s\s\s\s\s\svar\sresult\s=\scontextTest.LuminaireDb.ToList();\r\n\r\n\s\s\s\s\s\s\s\s\s\s\s\s//---\sVerification\r\n\s\s\s\s\s\s\s\s\s\s\s\scontextTest.Database.Connection.State.Should().Be(ConnectionState.Closed);\r\n\r\n\s\s\s\s\s\s\s\s\s\s\s\s//---\sAction\r\n\s\s\s\s\s\s\s\s\s\s\s\scontextTest.Dispose();\r\n\s\s\s\s\s\s\s\s\s\s\s\scontextTest\s=\snull;\r\n\r\n\s\s\s\s\s\s\s\s\s\s\s\s//---\sVerification\r\n\r\n\s\s\s\s\s\s\s\s\s\s\s\sFile.Exists(_testFile).Should().BeTrue();\r\n\r\n\s\s\s\s\s\s\s\s\s\s\s\s//\sfailed\sthrow\sIOException\r\n\s\s\s\s\s\s\s\s\s\s\s\sFile.Delete(_testFile);\r\n\s\s\s\s\s\s\s\s}
J login anonymous
J mimetype text/plain
J private_contact 22e3ca59f6ea2f967118a9b57df213a0a0bce9a2
J severity Critical
J status Open
J title System.Data.SQLite.EF6\shas\slock\son\sfile\safter\sDbContext.Dispose()
J type Code_Defect
K 165af4c68cd9dc26e6145abd44904f520cf18ded
U anonymous
Z 2a1c791a446f7a06b31f53556697d436