Subject | Sharing a connection between an exe and a DLL |
---|---|
Author | Robert martin |
Post date | 2006-05-17T21:45:55Z |
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.
--
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
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.
--
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd