Subject RE: [firebird-support] Embedded Firebird 2.1.1 keeps the database file opened
Author Alan McDonald
> > I am using FBLib Firbird Library v0.85
> > http://fblib.altervista.org/
> >
> > It is a Borland Packaged Library (.bpl) of classes that call isc_
> > functions
> > in gds32.dll.
> >
> > I disconnect from the database and then free the database object:
> > if (db <> nil) and db.Connected then
> > begin
> > db_name := db.DBFile;
> > db.DBFile := '';
> > db.Disconnect;
> > db_service.GFixSetShutDownDb(db_name, 1);
> > Sleep(1500); // Wait a little for the db to shut down
> > FreeAndNil(db);
> > end
> > [...]
>
> I don't use this lib. I use IBO exclusively. So I can't offer
> experience in
> the use if these calls.
> I see, though, that the Destroy procedure also disconnects from the
> service
> manager, which suggests that a connection makes this attachment by
> default.
> Also not sure about the shutdown logic here (above).
> I never shut my databases down (using embedded). Doesn't make sense
> since
> you are the only connection anyway. But the shutdown itself requires a
> persistent connection to ensure no new connections are established. So
> where
> is the logic in all this?
> Alan
>
>
>
> Well I am now thinking I also use IBExpert as a GUI for my database for
> testing,
> and I do not remember IBExpert having this problem ... Maybe it is
> indeed
> FBLib;
> now I am not even sure ! I shortly looked over the connect sequence in
> FBLib
> and I saw no file being opened though .... I will have to check again
> IBExpert and
> FBLib.
>
> The shut down and service manager connection I have only recently added
> in
> my
> code hoping that this will have some effect and close the (FBLib ?)
> handles
> on the
> database files.
>
> Thank you,
> Timothy Madden,
> Romania

maybe helen can shed some more light on this, but I think you're asking the
services manager to manage a DB shutdown which can't complete until all
connections are dropped. So you're defeating your purpose. Leave the whole
idea of shutdown out of the equation for the moment.
Alan