From: Thomas S. <ts...@ib...> - 2009-10-04 12:47:21
|
Hi Vlad, >> I have been creating new Delphi components/classes exposing the new >> Services API functionality in Firebird 2.5. While trace, nbackup, admin >> role mapping went smooth, I have a few problems with new shutdown/online >> modes. >> >> I'm using the constants from ibase.h for accessing the new >> shutdown/online modes: >> >> isc_spb_prp_force_shutdown = 41; >> isc_spb_prp_attachments_shutdown = 42; >> isc_spb_prp_transactions_shutdown = 43; >> isc_spb_prp_shutdown_mode = 44; >> isc_spb_prp_online_mode = 45; >> >> isc_spb_prp_sm_normal = 0; >> isc_spb_prp_sm_multi = 1; >> isc_spb_prp_sm_single = 2; >> isc_spb_prp_sm_full = 3; >> >> >> And the following parameters for accessing the properties action and >> setting the database name: >> >> isc_action_svc_properties = 8; (* Sets database properties *) >> isc_spb_dbname = 106; >> >> Are these the right constants to use? > > Yes Ok. That's a start then. >> Sorry, can only post Delphi here, but the shutdowndatabase method looks >> like that: >> >> >> TShutdownModeEx = (smeForce, smeAttachment, smeTransaction); >> TOperationMode = (omNormal, omMulti, omSingle, omFull); >> >> procedure TIBOConfigService.ShutdownDatabase(Options: TShutdownModeEx; >> Wait: Integer; OperationMode: TOperationMode); >> begin >> ServiceStartParams := AnsiChar(isc_action_svc_properties); >> ServiceStartAddParam(FDatabaseName, isc_spb_dbname); >> case OperationMode of >> omNormal: ServiceStartAddParam(isc_spb_prp_sm_normal, >> isc_spb_prp_shutdown_mode); >> omMulti: ServiceStartAddParam(isc_spb_prp_sm_multi, >> isc_spb_prp_shutdown_mode); >> omSingle: ServiceStartAddParam(isc_spb_prp_sm_single, >> isc_spb_prp_shutdown_mode); >> omFull: ServiceStartAddParam(isc_spb_prp_sm_full, >> isc_spb_prp_shutdown_mode); >> end; >> case Options of >> smeForce: ServiceStartAddParam(Wait, isc_spb_prp_force_shutdown); >> smeAttachment: ServiceStartAddParam(Wait, >> isc_spb_prp_attachments_shutdown); >> smeTransaction: ServiceStartAddParam(Wait, >> isc_spb_prp_transactions_shutdown); >> end; >> InternalServiceStart; >> end; >> >> >> So, basically, I'm setting the property_action first. Then the database >> name. After that, the provided operation mode (normal, multi, ...) and >> shutdown option. >> >> >> Any ideas, why I'm getting an "unrecognized service parameter block." here? > > I have absolutely no idea what ServiceStartAddParam doing. > > It will be much more useful if you show us SPB contents. Hmm, I don't know if this is useful either. The string representation of my PAnsiChar in Delphi for the SPB for a *successful* backup via NBackup looks like: #$14'j'#$C#0'eod_oltp.fdb'#6','#0'C:\misc\datenbanken\firebird25\eod_oltp.nbk0'#5#0#0#0#0 Or for a succesful Drop Admin Mapping call: #$1C The faulty shutdown/online call is: #8'j'#$C#0'eod_oltp.fdb,'#3#0#0#0'+'#$A#0#0#0 Any ideas? Thanks, Thomas |