records disappear [solved]

Re: records disappear

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8348
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: records disappear

Postby Antonio Linares » Fri Jan 25, 2013 4: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41351
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: records disappear

Postby James Bott » Fri Jan 25, 2013 5: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: records disappear

Postby Enrico Maria Giordano » Fri Jan 25, 2013 6: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
User avatar
Enrico Maria Giordano
 
Posts: 8348
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: records disappear

Postby Antonio Linares » Fri Jan 25, 2013 10:08 pm

Enrico,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41351
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: records disappear

Postby driessen » 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. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1396
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: records disappear

Postby James Bott » 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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: records disappear

Postby hmpaquito » Sat Jan 26, 2013 10:34 am

driessen,

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

regards
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: records disappear

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41351
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: records disappear

Postby reinaldocrespo » 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.
User avatar
reinaldocrespo
 
Posts: 972
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: records disappear [solved]

Postby lucasdebeltran » Tue Feb 05, 2013 7: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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: records disappear [solved]

Postby James Bott » Tue Feb 05, 2013 8: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 30 guests