Subject | Re: [IBO] Closing the IB_Connection |
---|---|
Author | Paul Vinkenoog |
Post date | 2004-05-30T23:09:31Z |
Hi Jason,
assume?
either:
- try to drop (delete) it, or
- try to restore a backup over it.
gfix -sh -tr n my_db.fdb
where n is the timeout in seconds.
If there are still unfinished transactions after n seconds, the
shutdown fails. You can then force it with
gfix -sh -f n my_db.fdb
After doing your thing, bring the database back online with
gfix -o my_db.fdb
By the way, the usual practice is to restore to a *new* file, not to
overwrite the existing db. If the restore succeeds, try to rename the
existing file to e.g. my_old_db.fdb. If the rename succeeds, nobody
was connected. If not, shut down using gfix and retry the rename.
Once the old db has been renamed, rename the restored db to the
original name. Then reconnect.
Greetings,
Paul Vinkenoog
> What is the proper way to close a connection? I am using theYou do (try to) close the database _before_ you do the restore, I
> IBOAdmin components to do a restore, but I can't seem to close the
> database.
assume?
> No matter what I do I get an error. I have tried all of theThe standard way is Disconnect.
> following.
>
> ForceDisconnect;
> CloseTransactions;
> Disconnect;
> Close;
> I get Error : lock time-out on wait transaction. object <databaseYou get a "could not drop" error if the database is in use and you
> path> is in use could not drop database <database path> (database
> might be in use)
either:
- try to drop (delete) it, or
- try to restore a backup over it.
> I have no pending statements at the time of this close down attemptYou can shut down all connections with e.g.
> - can anyone give me a snippet of delphi code for properly shutting
> down the current apps connection to the DB? and if there is a way to
> close down all connections to the db perhaps with a warning first, I
> could really use that info.
gfix -sh -tr n my_db.fdb
where n is the timeout in seconds.
If there are still unfinished transactions after n seconds, the
shutdown fails. You can then force it with
gfix -sh -f n my_db.fdb
After doing your thing, bring the database back online with
gfix -o my_db.fdb
By the way, the usual practice is to restore to a *new* file, not to
overwrite the existing db. If the restore succeeds, try to rename the
existing file to e.g. my_old_db.fdb. If the rename succeeds, nobody
was connected. If not, shut down using gfix and retry the rename.
Once the old db has been renamed, rename the restored db to the
original name. Then reconnect.
Greetings,
Paul Vinkenoog