FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour records disappear [solved]
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: records disappear
Posted: Fri Jan 25, 2013 12:04 PM
Antonio Linares wrote:If indexes are fine, then the technical reason that comes to my mind is that the writting of a record may fail randomly (and this could happen from the DBF engine itself, its a possibility).


A failed operation can corrupt the DBF or write garbage to the current record but can't delete the record and recompact the table.

EMG
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: records disappear
Posted: Fri Jan 25, 2013 04:49 PM

Enrico,

If a buffered chunk of data is written and part of it gets corrupted, that could do it

A log file (what I named a "backup" dbf) could reveal if the operation was done but the record vanished (?). I am just guessing, trying to imagine what may be going on... :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: records disappear
Posted: Fri Jan 25, 2013 05:32 PM

As Enrico, Antonio, and I have said, it is not possible for records to disappear from the middle of a DBF (unless a PACK or COPY TO has been done).

The only ways for records to seem to disappear is for the record to never have actually been written to the file (I have never had this happen), or for the original record to be overwritten by another record.

For troubleshooting (as Antonio suggested), you could create another DBF file and write the recno(), ID, date, and time every time a record is saved to the original DBF. Then you could later track exactly what happened.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: records disappear
Posted: Fri Jan 25, 2013 06:42 PM
Antonio Linares wrote:Enrico,

If a buffered chunk of data is written and part of it gets corrupted, that could do it


Then you would get a corrupted record not a vanished record.

EMG
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: records disappear
Posted: Fri Jan 25, 2013 10:08 PM

Enrico,

Yes, I think you are right about it :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: records disappear
Posted: Fri Jan 25, 2013 11:05 PM

Antonio,

Wouldn't your suggestion (using a backup DBF) not slow down the application enormously? In my application a few thousand new records are written every day. Some DBF-files have moren than 1.000.000 records.

Thanks.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: records disappear
Posted: Fri Jan 25, 2013 11:22 PM
Michel,

Wouldn't your suggestion (using a backup DBF) not slow down the application enormously?


I don't think he meant to create a backup of the entire database each time it was updated (if that is what you were thinking).

I think he just meant to add records to two identical databases. If it took 1 second to save to the original file, then it would only take 2 seconds to save to two files. This is not something that users would probably even notice. My concern with this is that if it is a coding issue that is causing the problem, then both databases would be identical and you learn nothing from them. If it is a corrupted index causing the problem then this would not affect both databases at the same time so you would see a problem.

However, as I suggested, you could just create a tracking dbf that only records four fields and this would probably be much faster. Regardless of coding or index problems this gives you a record of all changes to the original DBF.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: records disappear
Posted: Sat Jan 26, 2013 10:34 AM

driessen,

I have some DBFs with 10 million records, without problems.

regards

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: records disappear
Posted: Sat Jan 26, 2013 12:10 PM

Michel,

Is the only solution that I can think about (by now) to debug it. Maybe you could code it to set it on and off if required.

If a record disapears, then we need to have a concrete situation, some initial info and a way to reproduce it so if there is a problem, it could be reproduced, reported and solved :-)

As James explained, I don't think it will impact the overall performance of the app very much.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: records disappear
Posted: Tue Jan 29, 2013 12:12 AM

FYI - The problem of orphan child records can be solved using .Adt tables with a primary index key and simple Referential Integrity rules on the data dictionary. ...and it works with the local (free) version of the server just as well.

One other thing: In the old days, before I used the ADS server, I used to keep all tables closed at all times. If you need to update, insert, or delete a record, the application would open the table, do its thing, and then close it right away. That keeps corruption at bay and if you are only working with 5 or less users, it hardly hurts performance.

Hope that helps,

Reinaldo.

Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: records disappear [solved]
Posted: Tue Feb 05, 2013 07:53 PM

I confirm it was the antivirus.

Moving to Eset Nod 32 solved the problem.

Thanks for your feedback and very interesing advice.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: records disappear [solved]
Posted: Tue Feb 05, 2013 08:11 PM

I set antivirus proograms to ignore DBF and NTX files. In addition to other problems you don't want the antivirus software to scan DBF's and NTX's every time a record is saved.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion