Subject | RE: [IBO] CachedUpdates problem, |
---|---|
Author | Laurent GILBERT |
Post date | 2001-11-27T08:17:45Z |
Hi Jason,
After some works, problem results from BOOKMARK operations.
I've a "ApplyUpdates" general purpose procedure which save current position
in dataset before apply updates :
(*********************************************************************)
procedure pu_ibenreg_valider_modifs(vaDataSet_ds : TIBODataSet);
var
vlBookMark_pos_courante : TBookMark;
begin
with vaDataSet_ds
do begin
if (state = dsInsert) or (state = dsEdit)
then
CheckBrowseMode;
vlBookMark_pos_courante := GetBookmark;
if Modified and CanModify
then
Post;
ApplyUpdates;
if BookmarkValid(vlBookMark_pos_courante)
then
GotoBookmark(vlBookMark_pos_courante);
FreeBookmark(vlBookMark_pos_courante);
end;
end;
(**********************************************************************)
This procedure works well with last version of IBO3.6.
I trace my application in order to known where is the problem : Exception
raised in GotoBookMark().
GetBookMark() : I see local variable 'B' seems to be OK
('00000300000000000500433044434E2020202020202020202020').
BookMarkValid() : returns true because Abookmark assigned.
No post.
ApplyUpdates Ok.
GotoBookmark() : exception raises in IBODataset file at line 5327 :
"InternalDataset.Bookmark := BS;"
I disable CachedUpdates for all IBOQuery but not the concerned
Now, I've an error for an invalid foreign reference key !!!
I think there is an error in the CachedUpdates facility.
Rows of concerned table have 3 reference keys on this same table. Theses
keys are composed by 2 fields.
To copy data, I need 2 passes. Firstly in order to create rows without
links : Primary keys are defined. Secondly in order to updates references :
Fields TEQU_JOINT1_REF_EQU, TEQU_JOINT2_REF_EQU and TEQU_JOINT3_REF_EQU.
The new error occurs in ApplyUpdates...
For informations, this is the definition of the table :
CREATE TABLE T_EQU
(
TEQU_REF_SCENARIO INTEGER
CONSTRAINT CEQU_REF_SCENARIO_1 NOT NULL
CONSTRAINT CEQU_REF_SCENARIO_2 REFERENCES T_SCENARIO(TSCENARIO_ID),
TEQU_ID D_IDEQU
CONSTRAINT CEQU_ID NOT NULL,
CONSTRAINT CEQU_PK PRIMARY KEY (TEQU_REF_SCENARIO, TEQU_ID),
TEQU_REF_TEQU D_IDTEQU
CONSTRAINT CEQU_REF_TEQU_1 NOT NULL,
CONSTRAINT CEQU_REF_TEQU_2
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_REF_TEQU)
REFERENCES T_TEQU (TTEQU_REF_SCENARIO, TTEQU_ID),
TEQU_REF_TEQU_AMORPE D_IDTEQU,
CONSTRAINT CEQU_REF_TEQU_AMORPE_1
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_REF_TEQU_AMORPE)
REFERENCES T_TEQU (TTEQU_REF_SCENARIO, TTEQU_ID),
TEQU_PRIXUNIT D_PRIX,
TEQU_REF_LIAISON D_IDLIAISON
CONSTRAINT CEQU_REF_LIAISON_1 NOT NULL,
CONSTRAINT CEQU_REF_LIAISON_2
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_REF_LIAISON)
REFERENCES T_LIAISON (TLIAISON_REF_SCENARIO, TLIAISON_ID),
TEQU_QTE D_QTE,
TEQU_POIDSNET D_REEL64,
TEQU_POIDSBRUT D_REEL64,
TEQU_VOLUME D_REEL64,
TEQU_PRIX D_PRIX,
TEQU_REF_LOVE D_IDLSTOCK,
TEQU_REF_SITE D_IDSITE,
CONSTRAINT CEQU_REF_LOVE_1
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_REF_SITE, TEQU_REF_LOVE)
REFERENCES T_LOVE (TLOVE_REF_SCENARIO, TLOVE_SITE, TLOVE_ID),
TEQU_JOINTE D_BOOLEEN,
TEQU_DECLASSE D_BOOLEEN,
TEQU_SOUSDOUANE D_BOOLEEN,
TEQU_POS INTEGER,
TEQU_JOINT1_REF_EQU D_IDEQU,
CONSTRAINT CEQU_JOINT1_REF_EQU
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_JOINT1_REF_EQU)
REFERENCES T_EQU (TEQU_REF_SCENARIO, TEQU_ID),
TEQU_JOINT2_REF_EQU D_IDEQU,
CONSTRAINT CEQU_JOINT2_REF_EQU
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_JOINT2_REF_EQU)
REFERENCES T_EQU (TEQU_REF_SCENARIO, TEQU_ID),
TEQU_JOINT3_REF_EQU D_IDEQU,
CONSTRAINT CEQU_JOINT3_REF_EQU
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_JOINT3_REF_EQU)
REFERENCES T_EQU (TEQU_REF_SCENARIO, TEQU_ID)
);
Databases containts informations about stocked equipments uses to install
and repair intercontinental phone links.
Concerned table especially store data about cables. Cables could be link
together (two joins max). Some equipments are using to create branch : they
could have 3 links.
I hope you see where is the problem...
Regards,
Laurent GILBERT.
-----Message d'origine-----
De : Jason Wharton [mailto:jwharton@...]
Envoyé : lun. 26 novembre 2001 18:21
À : IBObjects@yahoogroups.com
Objet : Re: [IBO] CachedUpdates problem,
will work on this today if you do.
PS. I am going through all samples I have on file, even ones that I thought
I have fixed. I'm doing a big push to get all bugs cleared up possible
before I start on IBO 4.5. Which version will be the finalized port to Kylix
and I will drop Delphi & CPPB versions 3. (I have to get rid of all the
compiler directives for sake of clarity.) I will keep 4.2 for those using
Delphi 3 along with IBO 3.6 for those using Delphi 2.
Thanks,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
After some works, problem results from BOOKMARK operations.
I've a "ApplyUpdates" general purpose procedure which save current position
in dataset before apply updates :
(*********************************************************************)
procedure pu_ibenreg_valider_modifs(vaDataSet_ds : TIBODataSet);
var
vlBookMark_pos_courante : TBookMark;
begin
with vaDataSet_ds
do begin
if (state = dsInsert) or (state = dsEdit)
then
CheckBrowseMode;
vlBookMark_pos_courante := GetBookmark;
if Modified and CanModify
then
Post;
ApplyUpdates;
if BookmarkValid(vlBookMark_pos_courante)
then
GotoBookmark(vlBookMark_pos_courante);
FreeBookmark(vlBookMark_pos_courante);
end;
end;
(**********************************************************************)
This procedure works well with last version of IBO3.6.
I trace my application in order to known where is the problem : Exception
raised in GotoBookMark().
GetBookMark() : I see local variable 'B' seems to be OK
('00000300000000000500433044434E2020202020202020202020').
BookMarkValid() : returns true because Abookmark assigned.
No post.
ApplyUpdates Ok.
GotoBookmark() : exception raises in IBODataset file at line 5327 :
"InternalDataset.Bookmark := BS;"
I disable CachedUpdates for all IBOQuery but not the concerned
Now, I've an error for an invalid foreign reference key !!!
I think there is an error in the CachedUpdates facility.
Rows of concerned table have 3 reference keys on this same table. Theses
keys are composed by 2 fields.
To copy data, I need 2 passes. Firstly in order to create rows without
links : Primary keys are defined. Secondly in order to updates references :
Fields TEQU_JOINT1_REF_EQU, TEQU_JOINT2_REF_EQU and TEQU_JOINT3_REF_EQU.
The new error occurs in ApplyUpdates...
For informations, this is the definition of the table :
CREATE TABLE T_EQU
(
TEQU_REF_SCENARIO INTEGER
CONSTRAINT CEQU_REF_SCENARIO_1 NOT NULL
CONSTRAINT CEQU_REF_SCENARIO_2 REFERENCES T_SCENARIO(TSCENARIO_ID),
TEQU_ID D_IDEQU
CONSTRAINT CEQU_ID NOT NULL,
CONSTRAINT CEQU_PK PRIMARY KEY (TEQU_REF_SCENARIO, TEQU_ID),
TEQU_REF_TEQU D_IDTEQU
CONSTRAINT CEQU_REF_TEQU_1 NOT NULL,
CONSTRAINT CEQU_REF_TEQU_2
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_REF_TEQU)
REFERENCES T_TEQU (TTEQU_REF_SCENARIO, TTEQU_ID),
TEQU_REF_TEQU_AMORPE D_IDTEQU,
CONSTRAINT CEQU_REF_TEQU_AMORPE_1
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_REF_TEQU_AMORPE)
REFERENCES T_TEQU (TTEQU_REF_SCENARIO, TTEQU_ID),
TEQU_PRIXUNIT D_PRIX,
TEQU_REF_LIAISON D_IDLIAISON
CONSTRAINT CEQU_REF_LIAISON_1 NOT NULL,
CONSTRAINT CEQU_REF_LIAISON_2
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_REF_LIAISON)
REFERENCES T_LIAISON (TLIAISON_REF_SCENARIO, TLIAISON_ID),
TEQU_QTE D_QTE,
TEQU_POIDSNET D_REEL64,
TEQU_POIDSBRUT D_REEL64,
TEQU_VOLUME D_REEL64,
TEQU_PRIX D_PRIX,
TEQU_REF_LOVE D_IDLSTOCK,
TEQU_REF_SITE D_IDSITE,
CONSTRAINT CEQU_REF_LOVE_1
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_REF_SITE, TEQU_REF_LOVE)
REFERENCES T_LOVE (TLOVE_REF_SCENARIO, TLOVE_SITE, TLOVE_ID),
TEQU_JOINTE D_BOOLEEN,
TEQU_DECLASSE D_BOOLEEN,
TEQU_SOUSDOUANE D_BOOLEEN,
TEQU_POS INTEGER,
TEQU_JOINT1_REF_EQU D_IDEQU,
CONSTRAINT CEQU_JOINT1_REF_EQU
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_JOINT1_REF_EQU)
REFERENCES T_EQU (TEQU_REF_SCENARIO, TEQU_ID),
TEQU_JOINT2_REF_EQU D_IDEQU,
CONSTRAINT CEQU_JOINT2_REF_EQU
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_JOINT2_REF_EQU)
REFERENCES T_EQU (TEQU_REF_SCENARIO, TEQU_ID),
TEQU_JOINT3_REF_EQU D_IDEQU,
CONSTRAINT CEQU_JOINT3_REF_EQU
FOREIGN KEY (TEQU_REF_SCENARIO, TEQU_JOINT3_REF_EQU)
REFERENCES T_EQU (TEQU_REF_SCENARIO, TEQU_ID)
);
Databases containts informations about stocked equipments uses to install
and repair intercontinental phone links.
Concerned table especially store data about cables. Cables could be link
together (two joins max). Some equipments are using to create branch : they
could have 3 links.
I hope you see where is the problem...
Regards,
Laurent GILBERT.
-----Message d'origine-----
De : Jason Wharton [mailto:jwharton@...]
Envoyé : lun. 26 novembre 2001 18:21
À : IBObjects@yahoogroups.com
Objet : Re: [IBO] CachedUpdates problem,
> Problem occurs with 4.2 Fh version.Will you please send me a sample application that duplicates this problem? I
will work on this today if you do.
PS. I am going through all samples I have on file, even ones that I thought
I have fixed. I'm doing a big push to get all bugs cleared up possible
before I start on IBO 4.5. Which version will be the finalized port to Kylix
and I will drop Delphi & CPPB versions 3. (I have to get rid of all the
compiler directives for sake of clarity.) I will keep 4.2 for those using
Delphi 3 along with IBO 3.6 for those using Delphi 2.
Thanks,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
----- Original Message -----
From: "Laurent GILBERT" <laurent.gilbert@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, November 26, 2001 1:08 AM
Subject: RE: [IBO] CachedUpdates problem,
> Hi all,
>
>
> Bye.
>
> -----Message d'origine-----
> De : Laurent GILBERT [mailto:laurent.gilbert@...]
> Envoyé : lun. 26 novembre 2001 08:58
> À : IB_OBJECTS Support (E-mail)
> Objet : [IBO] CachedUpdates problem,
> Importance : Haute
>
>
> Hi all,
>
> I'm using IBO 4.2Fc version. I've translated my program from IBO 3.6 to
4.2
> last week without problems.
>
> I've a procedure to copy selected data from a database to another. I used
> IBOQuery components.
>
> In this case, it seems to me that IBO 4.2 is slower than IBO 3.6(????).
>
> I'm looking 'output' IBOQuery components and I saw CachedUpdates was
false.
> When I set them to true, an EintOverflow error exception raised at run :
> file "IB_NodeList" at line 655.
>
> Jason, if you want, I can send you screen copy of windows : "exception",
> "BufRef inspect", "CurRef inspect", "stack calls".
>
> "Apos" value was 540 but exception occurs with others values...
>
> Regards,
>
> Laurent GILBERT.
>
___________________________________________________________________________
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 !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/