Subject TIB_ColumnArray Limitations With Threads???
Author Andrew
Hi,

I have a replication application which succesfully replicated large
volumes of data from one Master DB to numerous target DB's on other
servers. To achieve this I have an array of Master DB connections,
one element of which is passed to each Thread.

This application works fine with the exception of ArrayColumns. I am
using the following code for this. This method works fine for a
single target but when I have multiple threads running together I
receive an "Error Writing To The Connection" or an "Error Reading
From The Connection" message, this occurs on the PutArray or GetArray
lines respectively.

DECLARATIONS:

TmpColArray: TIB_ColumnArray;
TmpArrSize : LongInt ;
Array_2D_Chr36 : Array[1..750, 1..30] of String[35] ;

CODE SAMPLE:

if sArrDim = '2' then
begin
TmpArrSize := LongInt(SizeOf(Array_2D_Chr36)) ;
TmpColArray := q.FieldByName('MYFIELD') As TIB_ColumnArray ;
if Not TmpColArray.IsNull then
begin
TmpColArray.GetArray(@Array_2D_Chr36,@TmpArrSize) ;
TmpColArray := Qry.FieldByName('MYFIELD') AS TIB_ColumnArray ;
TmpColArray.PutArray(@Array_2D_Chr36, @TmpArrSize) ;
end ;
end ;

All Declarations are private to the thread and I cannot find any
resources that are shared amongst the threads. Is there any reason
why this method might fail when used in multiple simultaneous threads?

Delphi 7, IBO 4.2.Ie


Thanks

Andrew