procedure TppReportExplorer.AddFolder and Interbase\IBExpress demo
Hi, All.
I'm using Delphi 2005 Arc. and RB9 server ed., Firebird 1.5.2
I don't know if this problem was fixed in updates, and a hurry search in
mailing lists found nothing interesting, so i'll try to explain below.
Starting from a fresh created and table-populated database from enclosed
script (metadata only, neither Explorer nor Dictionary data inserted),
I've a variant error conversion from null to integer immediatly when
trying to insert a new folder.
Investigating source code, rapidly became evident where AddFolder
procedure is weak (at least for Interbase and Firebird databases).
The procedure first inserts a new record with FolderName and parentId,
then posts.
At this point it is supposed that trigger before insert has fired and
record updated accordingly. So table RB_FOLDER is already empty from
another user transaction perspective (IBExpert i.e.) but generator
FOLDER_ID_GEN (that is outside transaction's perspective) is correctly
updated to value 2.
Then AddFolder try to read the updated value of field folderId (of type
variant) into a integer var: it's supposed to be 2, but inserting
breakpoint at line 2578 in ppRptExp
aFolderId := FFolderPipeline.GetFieldValue(FFolderFieldNames.FolderId)
values of record fields are , "New folder", 0.
FolderId is NULL?
Reading a NULL field yields a NULL variant value and NULL is NULL, not 0
(zero) so exception is raised.
Problem seems that LocateFolderRecord is not able to force updated
values when reading the only one record just inserted( empty dataset in
previous transaction, as seen from IbExpert)... mmmhhh.
May be a dataPipeline problem? I've not investigated more at the moment.
Note: inserting the first record from IBExpert gives results as
expected: folderId is updated at post, so there aren't problems in
database client and server services.
Anyway this is not a big problem, and inserting the first folder
manually is the simplest workaround.
May be i'll have similar problem in RB_ITEM table, need to test asap.
Meantime ideas or hints are appreciated, thanks in advance for your good
job.
Dott. Umberto Masotti
Università "G.d'Annunzio"
Chieti-Pescara
I'm using Delphi 2005 Arc. and RB9 server ed., Firebird 1.5.2
I don't know if this problem was fixed in updates, and a hurry search in
mailing lists found nothing interesting, so i'll try to explain below.
Starting from a fresh created and table-populated database from enclosed
script (metadata only, neither Explorer nor Dictionary data inserted),
I've a variant error conversion from null to integer immediatly when
trying to insert a new folder.
Investigating source code, rapidly became evident where AddFolder
procedure is weak (at least for Interbase and Firebird databases).
The procedure first inserts a new record with FolderName and parentId,
then posts.
At this point it is supposed that trigger before insert has fired and
record updated accordingly. So table RB_FOLDER is already empty from
another user transaction perspective (IBExpert i.e.) but generator
FOLDER_ID_GEN (that is outside transaction's perspective) is correctly
updated to value 2.
Then AddFolder try to read the updated value of field folderId (of type
variant) into a integer var: it's supposed to be 2, but inserting
breakpoint at line 2578 in ppRptExp
aFolderId := FFolderPipeline.GetFieldValue(FFolderFieldNames.FolderId)
values of record fields are , "New folder", 0.
FolderId is NULL?
Reading a NULL field yields a NULL variant value and NULL is NULL, not 0
(zero) so exception is raised.
Problem seems that LocateFolderRecord is not able to force updated
values when reading the only one record just inserted( empty dataset in
previous transaction, as seen from IbExpert)... mmmhhh.
May be a dataPipeline problem? I've not investigated more at the moment.
Note: inserting the first record from IBExpert gives results as
expected: folderId is updated at post, so there aren't problems in
database client and server services.
Anyway this is not a big problem, and inserting the first folder
manually is the simplest workaround.
May be i'll have similar problem in RB_ITEM table, need to test asap.
Meantime ideas or hints are appreciated, thanks in advance for your good
job.
Dott. Umberto Masotti
Università "G.d'Annunzio"
Chieti-Pescara
This discussion has been closed.
Comments
Make sure that you have DataPipeline.RefreshAfterPost set to True.
--
Nard Moseley
Digital Metaphors Corporation
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Ok, great!
I promise I'll buy me a pair of good glasses. ;-)
Dott. Umberto Masotti
Università "G.d'Annunzio"
Chieti-Pescara