Subject RE: [IBO] little bug in IBO4.5(A/B)
Author Laurent GILBERT
Hi Jason,

I don't have time now to make you a sample application, sorry....

The problem occurs in all editing forms when CachedUpdates is enabled and I
do a change (insertion or modification).

I saw that TIBODataSet.ApplyUpdates() seems to do " nothing " on a DataSet
with pending changes and cached updates enabled....

In my code, I've : " if transaction.CachedUpdatePendingCount > 0 then
transaction.ApplyUpdates([nil]) " ==> TIB_Transaction.ApplyUpdates generates
the exception.

That I saw :

My program calls TIBODataSet.ApplyUpdates() -->
TIBOInternal.ApplyUpdates() --> TIB_Bdataset.ApplyUpdates() -->
TIB_NodeList.ProcessUpdates() --> SysApplyUpdate() -->
AdjCuCounts(Anode, -1).

In AdjCuCounts and in inserting/deleting cases, you do a " Dec(cuInsCnt,
Aincrement = -1) that result of an incrementation of cuInsCnt.
For editing case, you do an " Inc(...). " !!!!

Because 4.3 and previous versions work well, I compare them with your last
one.

In 4.3, SysApplyUpdate calls AdjCounts() that decrement
cuInsCnt/cuEdtCnt/cuDelCnt.

I do some modifications in order that IBO works as before...

That's all...,

Laurent GILBERT

SPIRALE INGENIERIE
9 bis, place du Commerce
29280 PLOUZANE
Tél : +33 (0)2.98.05.00.98
Fax : +33 (0)2.98.05.01.32

-----Message d'origine-----
De : IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]De la part
de Jason Wharton
Envoyé : vendredi 24 juin 2005 21:22
À : IBObjects@yahoogroups.com
Objet : RE: [IBO] little bug in IBO4.5(A/B)

Thanks for going so far into the core of things with a potential fix. I
doubt it will actually be that simple of a fix but I have logged this to
look into.

Would you please send me a sample application that demonstrates the problem
you are confronting so I can see exactly what your context is?

Thanks,
Jason Wharton
www.ibobjects.com


> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of l_gilbert_fr
> Sent: Thursday, June 23, 2005 3:41 AM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] little bug in IBO4.5(A/B)
>
>
> Hi,
>
> I found a bug in TIB_NodeListe.AdjCuCounts in IBO 4.5B....
>
> I used IBO 4.3 in my application without problem (since IBO
> 3.x) and I
> try
> to use last version of IBO.
>
> But I have a big problem with IBO 4.5(A&B) : when I apply changes in
> an
> insert form, an exception occurs in TIB_Transaction.ApplyUpdates with
> "E_transaction_is_active".
>
> I found that UpdatesPending was always true even after a
> TIBODataSet.ApplyUpdates.
>
> After manys search, I found that TIB_NodeListe.AdjCuCounts works
> differently
> : you have to replace "dec()" by "inc()" in order to have correct
> counts.
>
> procedure TIB_NodeList.AdjCuCounts( ANode: PIB_Node; AIncrement:
> integer );
> begin
> if rfEdited in ANode.RowFlags then
> Inc( cuEdtCnt, AIncrement )
> else
> if rfInserted in ANode.RowFlags then
> // Dec( cuInsCnt, AIncrement )
> Inc( cuInsCnt, AIncrement )
> else
> if rfDeleted in ANode.RowFlags then
> // Dec( cuDelCnt, AIncrement );
> Inc( cuDelCnt, AIncrement );
> end;
>
> Regards,
>
> lg.



___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links