Subject Re: [IBO] Sharing a connection between an exe and a DLL
Author Markus Ostenried
At 09:45 Thursday, 18.05.2006 +1200, Robert martin wrote:
>Hi
>
>I have had a search back through my emails and found this gem ....
>
>Quote
>
>Jason has given Following Point in his FAQ
>
> When trying to share a connection DON'T try to share the
> reference to the IB_Connection component. Give every DLL
> its own TIB_Connection and simply share the connection
> handle between them. Use the dbHandle property and assign the
> value from it to the dbHandleShared property of the
> TIB_Connection components in the DLL instances. Use whatever
> means you want to pass the value, since it is just a simple
> integer.
>
> One vital point: close the TIB_Connection in the EXE before you
> terminate or destroy the DLL calls. Releasing the DLL resources
> before you close the TIB_Connection can cause some messy problems
> at termination!
> (Jason Wharton)
>
>End Quote
>
>
>Which is interesting because we have a client who is experiencing
>strange problems with our app and a custom dll we have written for
>them. It seems the last bit might be catching us out. We are freeing
>the dll before exes TIB_connection is closed. This is done for
>performance reasons (among other issues).
>
>Questions
>
>1) Does this still apply to the latest release of IBObjects?
>2) Are there any work arounds if it does apply?
>
>I am pretty sure this is causing us some fairly major problems.

Hi,

I know of this. But I'm sharing the reference to a TIB_Connection
among one exe and 15 dlls for about 4 years now. I haven't discovered
any problems so far. Do I need to worry?

Regards,
Markus