Closed ptakgit closed 3 years ago
Have you tried to do the same experiment with vDos?
@ptakgit - I forgot to flag your name in the previous message, so here's an alert for you...
Hi Emendelson,
with the VDOS program works correctly - the screenshots above come from VDOS . The problem is the cashing of files in the DOSBOX-X.
Daniel
@ptakgit - Thank you for reporting your results.
@ptakgit - Wengier Wu has written to me to ask me to post this response (I have no way of testing this; I am merely repeating what Wengier asked me to post):
It is recommended to set the config option "file access tries" to "3" in [dos] section of dosbox-x.conf in order to use the exact same code (and get the exact same result) in DOSBox-X and vDos/Plus. In fact, this is a good demonstration showing the difference between the setting "file access tries=0" and "file access tries=3" in the configuration. If I set it to 0, then I will get 100000 for the test program as reported, but if I set it to 3, then I will get 200000 just like in vDos/Plus.
Thank you for the suggested option. But I have serious doubts as to whether this solution is the right one. Why the value of the option "file access tries" set to exactly "3"? Because it started working on a particular PC and situation? What if, for example, due to windows load, another instance of the database program slows down and even the third attempt is not enough and data is lost. In addition, in a way that none of the applications will detect. Imagine an accounting application that losing data this way?
@ptakgit - I don't know the answer. I only repeated what @Wengier asked me to write. I hope he will visit the forum himself to respond to your questions. I believe Wengier is one of the authors of the relevant code, and he will surely know the answer.
@ptakgit So @emendelson asked me to answer your question directly here. As mentioned above, the setting "file access tries=3" simply tries to replicate the exact behavior of vDos/Plus in DOSBox-X for file locking. By setting "file access tries=3", DOSBox-X does exactly what vDos/Plus does for file/record locking, but in DOSBox-X it is more flexible since you can choose a different value for the setting "file access tries" and compare the result, or simply disable the access tries with the value "0" in DOSBox-X. Note that the value "3" is chosen and hardcoded in vDos/Plus because it has appeared to be a good choice for file locking purpose. By setting this value you simply get the exact same behavior for networking database operations in both DOSBox-X and vDos/Plus. Hope this helps.
Thank you for the explanation. Any value greater than zero worked correctly on my computer. Perhaps this setting should be set to "file access tries = 3" by default, because otherwise there is a risk of losing or damaging consistency when running simultaneously from several PCs on the same data.
The option file access tries = 3
is already the default for new Windows installations as suggested. Thanks for the confirmation that the said setting works as expected, and the test program mentioned in the post is a very good confirmation for the effectiveness of the file/record-locking functions in DOSBox-X.
Code of Conduct & Contributing Guidelines
Have you checked that no other similar bug report(s) already exists?
What operating system(s) this bug have occurred on?
WINDOWS 10 PRO 64 bite
What version(s) of DOSBox-X have this bug?
dosbox-x-win64-0.83.17
Describe the bug
Appending from more programs into the sharing database DBF files rewrite changes made by other program. If two programs simultaneously append records, finally only records from one program will be saved. I made a test program. It append 100.000 record into TEST.DBF. If you start it twice, there should be finally 200.000 records. But there is only half - 100.000 record s AppendTest.zip .
Expected behavior
expected result of two simultaneously instances - 200.000 records. DOSBOX-X get only 100.000 records.
Steps to reproduce the behaviour
Used configuration
Emulator log
No response
Additional context
No response