records disappear [solved]

Re: records disappear

Postby Otto » Thu Jan 24, 2013 6:09 pm

Jeff,
overwrite I can imagine also delete in conjunction with pack but
> Every now and then (very rare indeed) I will notice that a record has gone missing.
without a reason and not seeing a corruption inside the database I can’t.

But we must take this issue very serious because if there is really a problem with the database engine it can happen to every one of us.
Do you have more information.
I tried to delete exactly one record inside a dbf file with Multiedit.
But then if you try to open with a dbase editor you get a corruption detected error.

Best regards,
Otto


http://www.digitalpreservation.gov/form ... 0325.shtml
http://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6064
Joined: Fri Oct 07, 2005 7:07 pm

Re: records disappear

Postby Jeff Barnes » Thu Jan 24, 2013 6:51 pm

Hi Otto,

I have no good explanation as to what is causing this. All I know is that there are three of us that use my program in my office.
Only I have access to delete records.

Each new record is assigned a service report number (ie: 12001, 12002, 12003 etc...)
This number is locked from editing.

A while back I had to look up an old report (let's say it was 12120) ... I did the usual search via the program ... not found.
I did a reindex, searched again, not found.
I opened up the dbf file in an editor and manually looked through the entire database. Since the records are stored and created in order i would have expected to find the record right after 12119 but no. The records we as follows:
...
12117
12118
12119
12121
12122
etc....

Nowhere was there an entry for 12120 but I have a printed report for this item so I know it did indeed exist.
There was not even a blank entry where 12120 should have been. No deleted item ... just gone.

In the many years that we have used the program I think this has only happened two or three times.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: records disappear

Postby Enrico Maria Giordano » Thu Jan 24, 2013 7:00 pm

It looks like a bug in your code-generating function.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8367
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: records disappear

Postby Otto » Thu Jan 24, 2013 7:15 pm

Jeff,
I belive that you have a printed copy.
How do you print the records. Do you read from disk. I think you missed to commit and then the data is somewhere in the cache.
Maybe then there was a program error and the data was not written to the disk.
Is your data on a network dirive.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6064
Joined: Fri Oct 07, 2005 7:07 pm

Re: records disappear

Postby Jeff Barnes » Thu Jan 24, 2013 7:21 pm

Yes the records are read from the hard drive and yes on a network.
-Record is created when equipment comes in
-Any work done on equipment is entered into the record.
-The equipment is left running for 24 hours to verify the problem has been solved
-The record is re-opened, any additional comments added, and the final report is printed.

If it were a cache issue, the original record should still be in the system but without the added data.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: records disappear

Postby James Bott » Thu Jan 24, 2013 8:39 pm

Jeff,

Well, I agree with Enrico, without a PACK an existing record cannot be removed from a DBF file.

The only explanation for your example that I can think of, is that you printed the report, then a new record was created and it was saved over the existing record for the previous ID. I have had this happen in the past when I was using an index on the ID and the index was corrupted. To prevent this, I started turning off the index then using GO BOTTOM instead of using the index. GO BOTTOM has never failed me.

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 Otto » Thu Jan 24, 2013 8:46 pm

Hello James,
Would you be so kind to explain how index or go bottom has an effect if I add a record with append blank.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6064
Joined: Fri Oct 07, 2005 7:07 pm

Re: records disappear

Postby Jeff Barnes » Thu Jan 24, 2013 8:49 pm

I guess anything is possible. we don't use the software anymore for new reports ... only used now to pull up old ones.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: records disappear

Postby James Bott » Thu Jan 24, 2013 9:51 pm

Otto,

>Would you be so kind to explain how index or go bottom has an effect if I add a record with append blank.

Now I remember exactly what was happening. I was using an ID index to find the last used ID by issuing a GO BOTTOM (while the index on ID was the current index). Normally this worked fine, but when the index was corrupted I did get multiple copies of the same ID (because it wasn't seeing newly added records). This is not exactly what Jeff is seeing.

However, you cannot remove records from the middle of a DBF without doing a PACK or COPY TO, so one explanation for his example is that a new record was written over the top of the last record in the file. If the ID index was corrupted the new record may have been written over any other existing record in the file.

Or, possibly the missing record was printed on a report but never actually saved to the DBF.

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 Otto » Thu Jan 24, 2013 10:19 pm

Hello James,
do you know is the dbf database engine checks if the number of records corresponds to the value stored in the header.
Otherwise what happens if a antivirus software tries to repair a file and deletes some records inside a dbf file.
Best regards
Otto
4-7 32-bit number Number of records in the table. (Least significant byte first.)
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6064
Joined: Fri Oct 07, 2005 7:07 pm

Re: records disappear

Postby Enrico Maria Giordano » Thu Jan 24, 2013 10:23 pm

No. Even at very low level a sequential file (a DBF is a sequential file) can only be truncated (ie. deleted from a point to the end). To delete an inner part of it the only way is to copy it to another file.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8367
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: records disappear

Postby TimStone » Fri Jan 25, 2013 12:29 am

I'm glad this thread was started.

I don't believe in ghosts, or gremlins, but they still seem to exist in our computers.

I know what should not be able to happen, but I do know what does happen:
1) A "workorder" is created. It has totals, client link numbers, etc. When it is created it is Saved ! Then, when data is added ( connected ), it is also saved. The main workorder is stored in ord.dbf !
2) When parts are added to a workorder ( and labor ), they are linked with the workorder number. These records are all saved in their own files.
3) Example: Workorder 100005 is created. The number is drawn from a separate counter file. It exists in the ord.dbf file. When other items are added they also have the 100005 stored in the first field of their records.
4) A printout is made of 100005. It shows all detail and all connected parts. It is clearly in the system.
5) All entries are physically in numerical sequence. The saves are done when the record is first created, and when it is updated.
6) Several weeks later, a reprint is needed. The record is gone in the ord.dbf file ( but all the associated records still exist in their files ). If I manually add a new record for 100005 to the ord.dbf file, I can then print a full document and all of the related records in other files will show up as they should.

In each case I have investigated, the record is simply missing from the ord.dbf file. I've done numerous searches through the file to see if the data has been written over another record, but that is not the case.

It doesn't happen very often, but it does actually occur.

Perhaps there are ghosts and goblins out there, living our computer data.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: records disappear

Postby lucasdebeltran » Fri Jan 25, 2013 9:15 am

Timm,

Which antivirus do you use in that PC?.

Thanks
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

Postby Enrico Maria Giordano » Fri Jan 25, 2013 9:31 am

TimStone wrote:I know what should not be able to happen, but I do know what does happen


No, you only see the final effect that can have many different reasons to happen. Simply, the real reason is not the one you imagine.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8367
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: records disappear

Postby Antonio Linares » Fri Jan 25, 2013 10:30 am

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).

If this is the case, maybe you could use a (sort of) backup DBF where you also register your latest activity of the initial DBF.

If a record dissapears on the DBF, its initial existence should be in the backup DBF and that could provide more info for a pattern, or a way to reproduce it.
regards, saludos

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 62 guests