Subject RE: [IBO] IBO components in a thread
Author Don Schoeman
I've noticed a strange thing while trying to find this problem:

The point of failure is definitely when I'm trying to read a text blob from
the database. However, it happens on seemingly random records and sometimes
the loop runs through all the records without a problem.

Here are some more details:
The blob field is defined as a domain, such as this:
CREATE DOMAIN "XML_BLOB" AS BLOB SUB_TYPE TEXT SEGMENT SIZE 400;

The blobs contains XML data of around 6KB in size. I access the blob using a
simple statement such as this:
XMLStr := MyTable.FieldByName(SOME_XML_FIELD').AsString;

I sit in a loop, reading the blob data from the result set. XMLStr is simply
a string value. The statement above causes three random problems. Sometimes
it gives an "error reading connection" type error, sometimes it gives an
"invalid BLOB handle" error, and sometimes it simply hangs dead on the
statement as if something is sitting in a tight loop. Very weird indeed!

I actually do have other IBO components on the DataModule: They are: 1)
TB_SessionProps and 2) TIB_Events. I don't know if any of these two could
perhaps cause a problem?

Regards,
Don


-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
Behalf Of Don Schoeman
Sent: 04 July 2006 11:19
To: IBObjects@yahoogroups.com
Subject: [IBO] IBO components in a thread


Hi everyone,

I have developed a multithreaded server app. One of the threads is
exclusively used to access the FB database via IBO components which is
located on a DataModule. The thread also creates the instance of the
DataModule on which the IBO components are located. I only use
TIB_Connection, TIB_Transaction and one or two TIBO_Query components on
the
DataModule.

As I have mentioned, only this one "database" thread have access to these
components so that there can't be any conflicts between different threads
trying to access the components. After the database thread starts it
attempts to load some data from the database. However, I often get these
weird "error reading connection" and "invalid BLOB handle" error messages.
The database is fine as I can create a new one from scratch and it still
happens. I also tried restarting. This does seem to be a thread related
problem as I've never had this problem with standard Delphi apps. It's
also
quite intermittent and happens perhaps once in every 10 startups. When it
started successfully though it it never gets any problems.

I'm kind of out of clues and I'm hoping someone might have a vague idea of
what might be happening. I don't know the internals of IBO so I'm not sure
if there are any stuff in there which might not be thread happy. However,
I
doubt that is the case since in my view if only one thread access the
components then one shouldn't have a problem.

Any ideas from the clever people hanging around here will be greatly
appreciated!

Regards,
Don Schoeman

PS:
- Delphi 7 Professional
- IBO 4.3.Aa
- Firebird 1.5.1.4481






[Non-text portions of this message have been removed]