8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 09:20:39 +01:00
This commit is contained in:
asfernandes 2008-05-18 02:02:50 +00:00
parent 227ded525c
commit c9202a3767
6 changed files with 23 additions and 23 deletions

View File

@ -1,6 +1,6 @@
fb_shutdown(), fb_shutdown_callback() - new API call in firebird 2.5.
fb_shutdown(), fb_shutdown_callback() - new API call in Firebird 2.5.
Implements smart shutdown of engine. Primarily used when working with embedded firebird.
Implements smart shutdown of engine. Primarily used when working with embedded Firebird.
Author:
Alex Peshkoff <peshkoff@mail.ru>
@ -18,19 +18,19 @@ Syntax is:
Description:
fb_shutdown() performs smart shutdown of various firebird subsystems (yValve, engine, redirector).
fb_shutdown() performs smart shutdown of various Firebird subsystems (yValve, engine, redirector).
It DOES NOT perform shutdown of remote servers, to which you are currently attached - just
terminates any firebird activity in the current process. fb_shutdown() was primarily designed
terminates any Firebird activity in the current process. fb_shutdown() was primarily designed
to be used by engine itself, but also can be used in user applications - for example, if you want
to close all opened handles at once, fb_shutdown() may be used for it. Normally it should not be
used, because firebird libraries (both kinds - embedded or pure client) do call it automatically
used, because Firebird libraries (both kinds - embedded or pure client) do call it automatically
at exit(). To make fb_shutdown() be called at exit, you should attach at least one database (or
service).
fb_shutdown() accepts 2 parameters - timeout in milliseconds and reason of shutdown. Engine uses
negative reason codes (they are listed in ibase.h, see constants starting with fb_shutrsn), if
you need to call fb_shutdown() from your program, you must use positive value for reason. This
value is passed to callback_function, passed asan argument to fb_shutdown_callback(), and can you
value is passed to callback_function, passed as an argument to fb_shutdown_callback(), and can you
take appropriate actions when writing callback function.
Zero return value of fb_shutdown() means shutdown is successfull, non-zero means some errors took
@ -45,12 +45,12 @@ or ORed combination of them (to make same function be called in both cases).
Callback function has single parameter - reason of shutdown. There are 2 interesting shutdown
reasons:
fb_shutrsn_exit_called - firebird is closing due to exit() or unloaded client/embedded library
fb_shutrsn_exit_called - Firebird is closing due to exit() or unloaded client/embedded library
fb_shutrsn_signal - signal SIGINT or SIGTERM was caught (posix only)
This parameter can help you decide what action to be taken in your callback.
Zero return value of callback function means it performed it's job OK, non-zero is interpreted
depening upon call mask. For fb_shut_postproviders calls it means some errors took place, and
depending upon call mask. For fb_shut_postproviders calls it means some errors took place, and
non-zero value will be returned from fb_shutdown(). It's callback function responsibility to
notify world about exact reasons of error return. For fb_shut_preproviders non-zero means that
shutdown will not be performed. It's bad idea to return non-zero if shutdown is due to exit()

View File

@ -36,7 +36,7 @@ To return to default settings (windows administrators are not granted special ri
ALTER ROLE RDB$ADMIN DROP AUTO ADMIN MAPPING;
Take into an account, that if windows administrator attaches with role set in dpb, it will not be
Take into an account, that if Windows administrator attaches with role set in dpb, it will not be
replaced with RDB$ADMIN, i.e. he/she will not get SYSDBA rights.
- New parameter is added to firebird.conf - it is used to select available authentication method.

View File

@ -40,7 +40,7 @@ namespace MsgFormat {
namespace Firebird {
const TEXT SVC_TRMNTR = '\377';
const TEXT SVC_TRMNTR = '\377'; // ASCII 255
class ClumpletWriter;

View File

@ -8593,6 +8593,7 @@ static int API_ROUTINE query_abort(const int reason)
*
* Functional description
* Signal handler for interrupting output of a query.
* Note: this function is currently used in completelly different ways in Windows x POSIX.
*
**************************************/

View File

@ -396,9 +396,9 @@ void TRA_commit(thread_db* tdbb, jrd_tra* transaction, const bool retaining_flag
EDS::Transaction::jrdTransactionEnd(tdbb, transaction, true, retaining_flag, false);
/* If this is a commit retaining, and no updates have been performed,
and no events have been posted (via stored procedures etc)
no-op the operation */
// If this is a commit retaining, and no updates have been performed,
// and no events have been posted (via stored procedures etc)
// no-op the operation.
if (retaining_flag
&& !(transaction->tra_flags & TRA_write
@ -422,7 +422,7 @@ void TRA_commit(thread_db* tdbb, jrd_tra* transaction, const bool retaining_flag
Jrd::ContextPoolHolder context(tdbb, transaction->tra_pool);
/* Perform any meta data work deferred */
// Perform any meta data work deferred
if (!(transaction->tra_flags & TRA_prepared))
DFW_perform_work(tdbb, transaction);
@ -430,18 +430,18 @@ void TRA_commit(thread_db* tdbb, jrd_tra* transaction, const bool retaining_flag
if (transaction->tra_flags & (TRA_prepare2 | TRA_reconnected))
MET_update_transaction(tdbb, transaction, true);
/* Check in with external file system */
// Check in with external file system
EXT_trans_commit(transaction);
/* Commit transaction in security database ... */
// Commit transaction in security database ...
if (transaction->tra_secdb_transaction) {
ISC_STATUS_ARRAY status;
if (isc_commit_transaction(status, &transaction->tra_secdb_transaction) != 0) {
Firebird::status_exception::raise(status);
}
}
/* ... and detach from security database. */
// ... and detach from security database.
if (transaction->tra_security_database) {
ISC_STATUS_ARRAY status;
if (isc_detach_database(status, &transaction->tra_security_database) != 0) {
@ -981,7 +981,7 @@ void TRA_prepare(thread_db* tdbb, jrd_tra* transaction, USHORT length,
DFW_perform_work(tdbb, transaction);
/* Prepare transaction in security database for commit */
// Prepare transaction in security database for commit
if (transaction->tra_secdb_transaction) {
ISC_STATUS_ARRAY status;
if (isc_prepare_transaction(status, &transaction->tra_secdb_transaction) != 0) {
@ -1240,14 +1240,14 @@ void TRA_rollback(thread_db* tdbb, jrd_tra* transaction, const bool retaining_fl
if (transaction->tra_flags & (TRA_prepare2 | TRA_reconnected))
MET_update_transaction(tdbb, transaction, false);
/* Rollback transaction in security database ... */
// Rollback transaction in security database ...
if (transaction->tra_secdb_transaction) {
ISC_STATUS_ARRAY status;
if (isc_rollback_transaction(status, &transaction->tra_secdb_transaction) != 0) {
Firebird::status_exception::raise(status);
}
}
/* ... and detach from security database. */
// ... and detach from security database.
if (transaction->tra_security_database) {
ISC_STATUS_ARRAY status;
if (isc_detach_database(status, &transaction->tra_security_database) != 0) {
@ -1255,7 +1255,7 @@ void TRA_rollback(thread_db* tdbb, jrd_tra* transaction, const bool retaining_fl
}
}
/* If force flag is true, get rid of all savepoints to mark the transaction as dead */
// If force flag is true, get rid of all savepoints to mark the transaction as dead
if (force_flag) {
// Free all savepoint data
// We can do it in reverse order because nothing except simple deallocation

View File

@ -82,8 +82,7 @@ void WINAPI CNTL_main_thread( DWORD argc, char* argv[])
* Functional description
*
**************************************/
service_handle =
RegisterServiceCtrlHandler(service_name->c_str(), control_thread);
service_handle = RegisterServiceCtrlHandler(service_name->c_str(), control_thread);
if (!service_handle)
return;