Subject | RE: [IBO] Switching from FB embedded to normal FB client |
---|---|
Author | Tom Munro Glass |
Post date | 2003-11-17T22:11:55Z |
Thanks Jason. It will be fantastic if you can produce a TIB_Session that can dynamically switch DLLs.
I've done a bit of tracing through the code to see what's happening and have a question for you. Why do you initialize FGDS_RefCount = -1 and then call ReserveSessionHookRef twice in IB_Session.pas initialization? Also why do you need to call ReserveSessionHookRef / ReleaseSessionHookRef in IB_Components.pas initialization / finalization because IB_Components uses IB_Session so it will be loaded anyway?
I see that with IBO code linked in but no objects created, FGDS_RefCount reaches 2 because of the calls in the initialization section of IB_Session.pas and IB_Components.pas. So presumably I could call ReleaseSessionHookRef twice to unload the DLL, change IB_Constants.IB_GDS32 and then call ReserveSessionHookRef twice. Does that sound about right to you?
Regards,
Tom Munro Glass
I've done a bit of tracing through the code to see what's happening and have a question for you. Why do you initialize FGDS_RefCount = -1 and then call ReserveSessionHookRef twice in IB_Session.pas initialization? Also why do you need to call ReserveSessionHookRef / ReleaseSessionHookRef in IB_Components.pas initialization / finalization because IB_Components uses IB_Session so it will be loaded anyway?
I see that with IBO code linked in but no objects created, FGDS_RefCount reaches 2 because of the calls in the initialization section of IB_Session.pas and IB_Components.pas. So presumably I could call ReleaseSessionHookRef twice to unload the DLL, change IB_Constants.IB_GDS32 and then call ReserveSessionHookRef twice. Does that sound about right to you?
Regards,
Tom Munro Glass
> -----Original Message-----http://docs.yahoo.com/info/terms/
> From: Jason Wharton [mailto:jwharton@...]
> Sent: Tuesday, 18 November 2003 09:53
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] Switching from FB embedded to normal FB client
>
>
> If simultaneous usage is not required then you could get in
> under the hood
> and safely use the se methods to free the one DLL and Load
> the other. I
> think there may need to be some precautions taken, but go
> ahead and play
> around with it and see what happens. I'd like to know.
>
> And, I am trying to get things so it will be possible to use
> an explicit
> TIB_Session component that refers to the client it will make
> use of and the
> library will be one of its properties.
>
> Jason Wharton
>
> ----- Original Message -----
> From: "Tom Munro Glass" <tom@...>
> To: <ibobjects@yahoogroups.com>
> Sent: Monday, November 17, 2003 1:47 PM
> Subject: [IBO] Switching from FB embedded to normal FB client
>
>
> > I have an application that needs to be able to use FB
> embedded to access a
> local database or the normal FB client to access a remote
> database. It will
> always be working in one mode or the other - it does not need
> to use both
> methods simultaneously. The reason for the requirement is
> because FB server
> will not be installed on the machine running the application.
> >
> > I see that in IB_Session.pas the two methods
> AcquireOriginalHooks and
> ReleaseSessionHookRef are responsible for loading/unloading
> the FB DLL, the
> filename being provided by IB_Constants.IB_GDS32.
> >
> > My question is how can I use these methods to switch FB
> DLLs? Would it be
> safe to do the following:
> >
> > Before starting any database operations, set
> IB_Constants.IB_GDS32 to
> point at the appropriate DLL then call AcquireOriginalHooks.
> On completion
> of all database operations call ReleaseSessionHookRef.
> >
> > Tom Munro Glass
> >
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
> Printer at MyInks.com. Free s/h on orders $50 or more to the
> US & Canada.
> http://www.c1tracking.com/l.asp?cid=5511
> http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/PhFolB/TM
> --------------------------------------------------------------
> -------~->
>
> ______________________________________________________________
> _____________
> IB Objects - direct, complete, custom connectivity to
> Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ______________________________________________________________
> _____________
> http://www.ibobjects.com - your IBO community resource for
> Tech Info papers,
> keyword-searchable FAQ, community code contributions and more
> !
>
> Your use of Yahoo! Groups is subject to