On 2020-03-10 22:04, Steve Naidamast blackfalconsoftw...@outlook.com [firebird-support] wrote: > Hello... > > I am developing a security extension, which is used as a loaded > assembly to my main application, all of which use the Firebird > Embedded Edition 2.59 for my application's database. > > As part of my security processes, I compress the file upon exiting > the application. When the compression process is completed, I want to > delete the Firebird FDB database file. However, I cannot do this as > the Firebird database file is in use by the application. > > I have checked all of my data access coding and in every case the > associated database connection is being properly closed upon > completion of any database access method. > > As a result, I have no idea why the Firebird FDB database file is > still being used by the master application. > > Does anyone have any ideas as to how I can get around this so I can > complete the delete process?
IIRC, you are programming in C#, right? The Firebird ADO.net provider uses a connection pool, so although the logical connection used by your application maybe closed, the physical connection is still open. You can close unused connections in the pool using FbConnection.ClearAllPools() (or alternatively, use the connection property to not pool the connections). Mark