from Derek Davidson, CTO
Asta Technology Group, Inc.
Following on from some requests from users and my own work, I have
researched threading issues for our InterBase related servers.
Many of you are probably (rightly) enamored of the Open Source Edition
of InterBase. The prospect of being able to deliver an application
that uses an industrial grade C/S database, at no additional cost to
you or the customer has to be attractive.
We at Asta provide support for a number of databases and we support
connecting to InterBase through our BDE, InterBase Express, ODBC and
IBObjects servers. Each of these servers has their own particular plus
points, though it's fair to say that when it comes to deploying an
InterBase solution, most people would use either InterBase Express or
IBObjects as they give direct access to InterBase with the expected
benefits of speed and accessibility.
Please note that I have NOT tested InterBase against either our ODBC or
our BDE based servers and this is something that you may wish to do for
yourselves. I can tell you that both of those servers do thread well
under all normal circumstances.
Between InterBase Express and IBObjects, many select InterBase Express
as it comes with Delphi itself (and is therefore free) and is also
supported by Borland.
Following observations by some Asta users, we discovered that our
InterBase Express (IBX) server was NOT thread safe. Our original
response to this was, essentially, to blame InterBase. Our reply was
based on threading issues that some InterBase users had reported in
public newsgroups, concerning InterBase itself.
Notwithstanding, I researched as much as I could on the problem but was
unable to produce an Asta IBX Server that threaded succesfully.
I then conducted tests with the Asta IB Objects (IBO) server. It
passed our internal threading soak test without a single error. For
us, this proved that the issue was not database related, but component
related.
Therefore, with immediate effect, we regret to announce that we cannot
support threaded Asta servers based on the Borland InterBase Express
components. I will continue research in this area and will inform you
as and when I am able to fix the extant issues.
For those users who do have customized InterBase Express based Asta
servers, and want to use either of our multi-threading models, I
strongly recommend changing over to IBObjects. I have made one such
translation myself and this process took two days (including testing).
If you need assistance in doing this, pleas feel free to contact me.
"The SQLDA bug"
This is the infamous bug in InterBase itself.
In version 3.6 Ba I changed the way IBO reacts to the ill effects of this
bug. Here is what I said about it in the release notes:
I changed the code which automatically responds to the InterBase bug that mainly shows itself with executing stored procedures from remote clients, such that it won't execute it a second time in an auto-recovery situation, but instead will raise the exception.
IBO checks the StoredProcHasDML property value to determine what it has to do. Some people were complaining that their stored procedures were being executed twice and messing things up.
Now I have made it more obvious that there is a problem that should be worked around. The work-around is to put a SUSPEND in the stored procedure and then either use a TIB_Cursor or set the stored procedure component's StoredProcForSelect property to true. This way you avoid the API call that has the bug in it.
So, everyone, you need to work around this bug and not rely on IBO to smoothe it out. There is no safe way (generic) that I can do this for you.