Subject | RE: [IBO] TIB_ColumnArray Limitations With Threads??? |
---|---|
Author | Jason Wharton |
Post date | 2007-03-10T06:05:18Z |
You may need to serialize the handling of array columns. There may be
something in the way variants are used or something in the client dll that
is not thread safe.
Jason Wharton
something in the way variants are used or something in the client dll that
is not thread safe.
Jason Wharton
> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of Andrew
> Sent: Tuesday, March 06, 2007 7:49 AM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] TIB_ColumnArray Limitations With Threads???
>
>
> 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