Page 1 of 1

Firebird 2.1, ZTable data lost

Posted: 30.04.2009, 12:59
by SlavoF
Hi,
ZEOSLIB_TESTING_REV617 , D2009 , Firebird 2.1
Import data from paradox table into TZTable:
cashedupdates=false
autocommit=true
while not ImportTable.eof
...
ZTable.Append;
...
for I :=0 to ZTable.FieldCount-1
ZTable.FieldByName(FName).Value := FValue;
...
ZTable.Post;
...
All rows and fields are imported - Before1.jpg
if call ZTable.Refresh or ReOpen -> some data lost - After1.jpg

if run same procedure with
ZSQLProcessor1.Script.SetText('INSERT INTO ZTABLE VALUES ....);
ZSQLProcessor1.Execute;
All is OK

Posted: 30.04.2009, 13:01
by SlavoF
after

Posted: 04.05.2009, 00:32
by mdaems
Did you try to add a tzsqlMonitor to your project to check what commands are sent to the server exactly? Where are the differences?

Mark

Posted: 04.05.2009, 15:06
by SlavoF
yes

Posted: 04.05.2009, 15:14
by SlavoF
hmm ... ,
interesting

Posted: 04.05.2009, 15:33
by mdaems
How's that file encoded? Doesn't look like plain ascii... I'll try to decode it later. Winmerge doesn't like it... (for comparison)

Mark

Posted: 04.05.2009, 15:44
by SlavoF
yet once

Posted: 05.05.2009, 23:21
by mdaems
Hi,

From a first look at the first log ('wrong') I have the impression you may have found som bug in the handling of prepared statements in combination with autocommit.
cat: Execute, proto: firebirdd-2.1, msg: SELECT a.RDB$RELATION_NAME, a.RDB$FIELD_NAME, a.RDB$FIELD_POSITION, a.RDB$NULL_FLAG, a.RDB$DEFAULT_VALUE, b. RDB$FIELD_LENGTH, b.RDB$FIELD_SCALE, c.RDB$TYPE_NAME, b.RDB$FIELD_TYPE, b.RDB$FIELD_SUB_TYPE, b.RDB$DESCRIPTION, b.RDB$CHARACTER_LENGTH, b.RDB$FIELD_PRECISION, a.RDB$DEFAULT_SOURCE, b.RDB$DEFAULT_SOURCE as RDB$DEFAULT_SOURCE_DOMAIN,b.RDB$COMPUTED_SOURCE as RDB$COMPUTED_SOURCE FROM RDB$RELATION_FIELDS a JOIN RDB$FIELDS b ON (b.RDB$FIELD_NAME = a.RDB$FIELD_SOURCE) LEFT JOIN RDB$TYPES c ON (b.RDB$FIELD_TYPE = c.RDB$TYPE and c.RDB$FIELD_NAME = 'RDB$FIELD_TYPE') WHERE a.RDB$RELATION_NAME = 'FIRMY' ORDER BY a.RDB$RELATION_NAME, a.RDB$FIELD_POSITION
cat: Execute, proto: firebirdd-2.1, msg: SELECT GEN_ID("FIRMY_ID_FIRMY_GEN", 1) FROM rdb$generators WHERE rdb$generators.rdb$generator_name = 'FIRMY_ID_FIRMY_GEN'
cat: Prepare, proto: firebirdd-2.1, msg: Statement 2 : INSERT INTO FIRMY (ID_FIRMY,OBCH_MENO,ICO,DIC,ICDPH,PREVADZKA,ULICA,MESTO,PSC,KODKRAJINY,KRAJINA,OKRES,REGION,UCET,KODBANKY,BANKA,TEL,FAX,MOBIL,EMAIL,WWW,KONTAKT,DOH_O_ZAST,IDENTJCD,IDENTJCD_KR,TIN_NCTS,TIN_NCTS_KR,ISTAT_SJ,ISTAT_TYP,CISLOOJ,PARTNER,CU_ID,CU_NAME,ZJED_PRIJ,ZJED_ODOS,POZNAMKA,ZMENA_DATUM,ZMENA_MENO,VISIBLE) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
cat: Bind prepared, proto: firebirdd-2.1, msg: Statement 2 : 1,' SA & KOVO - HALLA, s.r.o.',(NULL),(NULL),'SK2020208080',(NULL),'Ulica','Kostolište è.162','90062','SK',(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),0,(NULL),'SK',(NULL),(NULL),0,(NULL),'000',0,(NULL),(NULL),0,0,(NULL),(NULL),(NULL),1,
cat: Transaction, proto: firebirdd-2.1, msg: TRANSACTION COMMIT
cat: Execute prepared, proto: firebirdd-2.1, msg: Statement 2
cat: Execute, proto: firebirdd-2.1, msg: SELECT GEN_ID("FIRMY_ID_FIRMY_GEN", 1) FROM rdb$generators WHERE rdb$generators.rdb$generator_name = 'FIRMY_ID_FIRMY_GEN'
cat: Bind prepared, proto: firebirdd-2.1, msg: Statement 2 : 2,'A-HINSKE Warenhandels GMBH',(NULL),(NULL),(NULL),(NULL),'Sitterstiege 6','Coesfeld','48653','DE',(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),0,(NULL),(NULL),(NULL),(NULL),0,(NULL),'000',0,(NULL),(NULL),0,0,(NULL),(NULL),(NULL),1,
cat: Transaction, proto: firebirdd-2.1, msg: TRANSACTION COMMIT
cat: Execute prepared, proto: firebirdd-2.1, msg: Statement 2
The 'TRANSACTION COMMIT' statements that appear between the BIND and EXECUTE commands seems suspicious to me.
Did you try this with autocommit=false?
And a more difficult question : would it be possible to
- package a sample project that doesn't require Paradox. eg by copying from another Firebird table on a second connection or using a hardcoded array of data
- zip everything (=project without exe and full embedded server data+dll+...)
- send the zip file to zeoslib<at>gmail<dot>com

Mark

Posted: 06.05.2009, 12:25
by SlavoF
Hi,
autocommit=false not work
mail has been sent
thanks