PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → WD17 - HFSQL Classic Write Data is slow
WD17 - HFSQL Classic Write Data is slow
Iniciado por guest, 04,mar. 2015 12:56 - 5 respuestas
Publicado el 04,marzo 2015 - 12:56
Hello All,

In have developed a small software in WD17.

In the software there is a Window in which there is a ComboBox in which Data is loaded from a Query. Besides the ComboBox there is a button. When the user clicks on the button it will show Window to add a new entry in database. Once the Window is closed there is code to re run the query and reload the contents in ComboBox.

The code is as below:
Open(WIN_CustomerMasterEntry,True,0) //If we need to add new Second Param is True and Last Param is always 0 HExecuteQuery(QRY_CustomerMaster) ListDisplay(COMBO_JobWorkCustomer,taInit) COMBO_JobWorkCustomer = -1
This code is working fine on my PC but when we deployed the compiled software to another PC it is not working.

After analyzing I think the problem is that the Data File in which the data is saved is not updated immediately from the Window that allows to add a new entry to the file. It seems to get buffered

Again if we restart the software in question the data that was added previously shows up properly.

So how can we force HFSQL Classic to write all the data immediately when a Window closes?

Is there any solution for this problem? Can the Pros please guide me here.

TIA

Yogi Yang
Publicado el 04,marzo 2015 - 13:29
Hi Yogi
check the HSecurity, HFlush functions.
Publicado el 04,marzo 2015 - 13:50
Hi yogi,

The tainit code forses the ititiation code of the combo. If there is nothing then nothing is done. And thus no refres of the list.

You could add a query ( internal ) query that loads the combobox. in th initiation code of the list ( combo ) you specify query prameters if you need to with

mysource.parameter = parameter.

you can use a query like you are doing now but then add it to the initiation code of the combo. Then running the combo(combo,taini) will run the query and refress the list as you would want.

regards
Allard
Publicado el 04,marzo 2015 - 14:43
Hi Yogi,

Adding to Paulo, this is normal SMB protocol behaviour if your files are shared on a network drive. Windows will use opportunistic locking to decreas network i/o. You can read this very good article we used for years about that if you want to know more: <a class="ExternalLink" rel="nofollow" target="_blank" href="http://www.dataaccess.com/whitepapers/opportunlockingreadcaching.html">http://www.dataaccess.com/whitepapers/opportunlockingreadcaching.html</a>

If you want a real solution, use HyperFileSQL Client/Server even if this is on a standard workstation. You will save hours of weird code behavior and debugging. HFSQL CS is your friend. We simply do not use Classic HFSQL anymore, except if this is a stand-alone workstation. The moment there are 2 users we use HFSQL CS.

Best regards!
Alexandre Leclerc

Edit 1: Fixed URL.
Publicado el 04,marzo 2015 - 19:10
Hi

I agree with Alexandre. I use onley hf cs. You get backup etc for free as well

regards

Allard
Publicado el 07,marzo 2015 - 12:57
Thanks everyone for your replys.

I am playing at the moment with HFlush and FSecurity.

I hope these two will save me the trouble that I am facing.

At the moment the software is build on HFSQL Classic but after 2 months planning to rewrite it from scratch and hoping to use HSSQL CS in the new version.

Regards,

Yogi Yang