Hi all!
It's quite clear that utilities that directly access database file (like
nbackup) can't work with non-native ODS. This does cause problems when
using that utilities as services - see
https://github.com/FirebirdSQL/firebird/issues/7579. Original
multi-providers architecture was not designed to be used with services -
as far as I can see, services came to life in a period when
multi-providers mode was almost unsupported.
Therefore some extension of access to multiple providers is needed. I
can suggest 2 possible solutions.
1. Add to Provider interface new entry performing invocation of service
thread in context of that provider. It will be invoked when native
thread failed to start (probably with limited set of errors returned).
That's straightforward approach and can be implemented relatively easy,
but has one disadvantage - need to add to public API call absolutely
unneeded to users, moreover it will go to the central part ob DB access
API.
2. Use already existing isc_spb_expected_db parameter when attaching to
services manager. Additional functionality will be check for attach to
that database (and detach at once) when connecting to services manager.
This will help to use correct services manager at once. But in a case
when isc_spb_expected_db is not specified by user (and that's normal
practice) we will need to chain the call to attach to services in a case
of utility startup error. In that chained call we can specify correct
isc_spb_expected_db parameter and chain all calls to services manager to
resulting interface until next service start call. This approach does
not require to expose something to users, but definitely more complex
and can probably have unexpected side effects.
What to be chosen? May be better ideas?
Alex.