PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Data in database table gets missing!!!
Data in database table gets missing!!!
Iniciado por guest, 09,dic. 2015 09:26 - 7 respuestas
Publicado el 09,diciembre 2015 - 09:26
Hello Mates;

I am facing an unusual scenario nowadays..I have a Windev application running and with Hyper file SQL as the database for the application. Everything works fine but now its showing some abnormalities like missing data. I will explain- i have one database table where a set of details regarding a product is stored, during some event of time this line actually gets empty(gets the data to zero instead of values). This is one difficult situation and I double checked my program and couldn't find out any code which empties the data in the database table.

Thanks in advance and requesting any idea/suggestions for the same
Publicado el 09,diciembre 2015 - 10:01
Hi Amal, did you repair the database?
Publicado el 09,diciembre 2015 - 11:14
Hiii Guenter;

This is not a frequent issue, the database and programs works fine for a time period and after that period some line of data will be made empty or zero in all fields. Its also not happening any particular table fields in different scenarios the data missing table changes.

Thanks for you kind reply
Publicado el 09,diciembre 2015 - 11:41
Hi Amal,

I would suspect a bug in your code anyhow.

What you could do to trace more down is to have a Background task (Timer, thread or paralleltask) to check the particular database/table posting an error when it happens so the "What just happend now" could be narrowed down and the bug resolved.

I`ve have a lot of users using HF/SQL and classic, none has reported this (also it`s the first time as I recall on this forum to)

cheers
Tor-Bjarne
Publicado el 09,diciembre 2015 - 12:09
Hi Amal,

in my experience, this can happen in two cases:

1. a bug in your code (most often, a side effect of a wrong use of variable, but it can be a number of things, and is generally quite a pain in the butt to find)

2. a hardware problem corrupting the data during a write (power, network, hard drive, ram...).


It is most likely problem 1, as problem 2 would ALSO result in index problems that would oblige you to reindex regularly, and you are not talking about that.

Best regards
Publicado el 09,diciembre 2015 - 12:44
Hi Amal,

Without knowing your coding style I expect this to be a bug typically caused by a record pointer still open to the record (hread, hreadseek, hreadseekfirst, hposition, ...) followed by a re-initialisation (hreset, Reset, assignment, ...) and an hModify...

Ideally you try to nail down the scenario in which this happens so you can identify the coding blocks involved in that scenario and next debug it locally.

When using HFCS, you can activate logging on that table to identify when it happens and hopefully you're using audit fields in your tables as well (user, last update timestamp, creation timestamp, function/procedure/method) to identify the source of the update.

Good luck!

Peter H.
Publicado el 09,diciembre 2015 - 12:47
Hiii Tor-Bjarne and dear Fabrice Harari;

First i would like to thank you for your reply.

Regarding the code i have tried the same debugging many days and couldn't find anything creepy to make my data missing. The same code and application i tried running on another client site works fine.

Secondly the data table where the data finds missing is a read only table, the application code is written in such a way it writes to that table when any new item is created and after creating that line of data of that particular item then the application only reads that line never modifies it.

I wonder how the full line become empty filled with "zero" replacing all data!!!!
Miembro registrado
197 mensajes
Publicado el 11,diciembre 2015 - 19:01
1) Have you tried to get return info by putting breakpoint or info message to trap "zero values" or "no value" written in tables?
2) is your application running alone on database and does triggers exist?