Subject Docs for gfix -shut : decide on -attach, -tran, -force
Author Michael Ludwig
Database Startup and Shutdown >> Database Shutdown
http://www.firebirdsql.org/manual/gfix-dbstartstop.html

I've just been reading parts of the GFIX manual. It took me some time to
understand when you would want to specify -attach or -tran when shutting
down a database.

I think I got it now:


-shut -attach <n>

You want the shutdown to succeed only if after <n> seconds there are no
remaining attachments (connections) to the database. In other words, you
want everybody to log off within <n> seconds; else fail. (On the other
hand, existing attachments may still start new transactions.)

-shut -tran <n>

You want the shutdown to succeed only if after <n> seconds there are no
active transactions on the database. In other words, you want everybody
to commit or abort their work; else fail. This is less strict than
-attach <n> as you don't require people to log off the database. (On
the other hand, it could be seen as stricter as you prevent people from
starting new transactions.)

-shut -force <n>

You want the shutdown to succeed unconditionally after <n> seconds.
Users may have attachments or active transactions, but you really don't
care: they've got <n> seconds to get stuff done, and then it'll be too
late and they'll be disconnected and their work discarded. Fair enough,
there's important admin work to be done.


Is this about correct? If it is and you find it useful, maybe you'd
like to include it into the section of the guide I referred to above.


One thing I'm still wondering about is why you would prefer -attach
to -tran when shutting down? If the objective is to prevent work from
being carried out on the database then, while both -tran and -attach
are effective, -tran seems to be more efficient as it preempts new
transactions during the grace period of <n> seconds but doesn't require
users to log off. If this question has a good answer I think it might
also be a worthwhile addition to the manual.

Michael