Welcome! Log In Create A New Profile

Advanced

[HF Classic] Which is the correct way to use it?

Posted by RAUL 
[HF Classic] Which is the correct way to use it?
April 03, 2019 08:46PM
Hello everybody.

I have an old system with 4 exes and the DB in HF Classic mode. The apps directory is a shared folder with proper permissions. It was working fine for many years. The directory used to reside on a Win XP (imagine how old it is...)

That box was replaced and the entire system migrated to a Win 7 environment (the client has some remaining "7" licencies yet...) Since then, the apps have multiple problems and all of them are practically the same: can`t lock the files (tables) to insert or modify records. The apps uses transactions and they worked fine for many years onto XP. I can't figure out why now the client is having these problems. The log error I generate from the apps shows mainly the error code 70100 (locked files).

Sometimes, I can see the .TRS, .TRX, .NDX and/or .LOCK files generated in the directory. One curious thing is that those files remains there for many seconds before just disapair. Before that, I don't remember to even see those files, the transactions was fast. My main suspect was the SEP antivirus, but it was installed before in the old XP and everything went ok. Of course, I added exceptions to the antivirus, I've made changes to the apps, but the problems remains...

Have you any suggestions in order to solve this?

Additionaly, can you please point me in the right direction about how do you use apps with HF Classic in shared folders?

I was thinking about to update the system to use HFCS, but I'm not sure whether or not this will solve the issue...

Best regards.
Al
Re: [HF Classic] Which is the correct way to use it?
April 03, 2019 09:39PM
Hello Raul

HF Classic is just fine on Win7. I have a couple of clients using HF Classic, running Win7 and Win10 clients going back to a Win7 "Server". It probably shouldn't work but it does.

The first thing I would check is that you have enabled "Multi-users" in the Management mode section of the "Files" section in the project description. The only locking I do on my apps is when I need to update a running number sequence, like an invoice number, other than that I let Windev manage the locks. If you have coded a locking regime, try turning it off.

I have never used transactions so I can't comment on that aspect.

In terms of checking the permissions, a quick way to test is give the users admin rights temporarily to see if that fixes the problem - although permission problems generally return a "read" error rather than a lock issue.


Regards
Al
Re: [HF Classic] Which is the correct way to use it?
April 03, 2019 10:08PM
Thanks Al for your reply.

The multi-users mode is on. I can't generate the problem by myself. It seems the apps work ok for a while until they start to fail because of the lock problem.

I've already tried the admin rights for the users but the problem remains.

In one of this apps there's a situation like the one you discribe: update a sequence number. The weird thing is that all this was working ok for years when the system used to reside on a XP box. The transactions are absolutly nesessary because I have to modify 2 or more tables at once and this must be done as a whole or discarded.

Regards.
Re: [HF Classic] Which is the correct way to use it?
April 04, 2019 07:02AM
Hi Raul,

please note that "transactions" now are much more complex than they used to be. There are 4 different ways to use transactions. Btw, which version of WINDEV do you use for this program now? Al already recommended to do away with the locking stuff, it's not needed anymore. Personally, I'm using rather complex locking code within a procedure for the usually rare retrieving / updating auf sensitive numbers. I did not take the time to read all of the complex stuff about the new transactions. Some day I shall do that, some day ...

Kind regards,
Guenter Predl
office@windev.at



Edited 1 time(s). Last edit at 04/04/2019 07:03AM by gpredl.
Re: [HF Classic] Which is the correct way to use it?
April 04, 2019 02:08PM
Hi Guenter.

This is an old system coded in WD 14. I had no idea about new ways of transactions (in newer versions). The last WD verstion I have access to is 18. Sadly, WX is too expensive for me and there is no demand where I live.

As "rule of thumb", I never switch to a newer version of any software, until it's absolutly nesessary. In the last 21 years, I've had some bad experiences with that. Right now, I can say that the only peace of software I really trust to update is Mikrotik ROS (I also work in network infraestructure but my real passion is to code with WD...)

My transactions are realy simple; just an example:

HTransactionStart()
IF NOT HExecuteQuery(QRY_InsertTMP,hCheckIntegrity+hQueryDefault,{cQrySearchName+ ".tur_id",indItem}, WIN_MAINavisos.COMBO_ASE_ID) OR ...
NOT HExecuteQuery(QRY_UpdateTUR_Tomar,hCheckIntegrity+hQueryDefault, {cQrySearchName+ ".tur_id",indItem}, WIN_MAINavisos.COMBO_ASE_ID, Today()+ Now())

			HTransactionCancel()
			Warning(cOtherUser)
			HCancelDeclaration(QRY_InsertTMP)
			HCancelDeclaration(QRY_UpdateTUR)
ELSE
			HTransactionEnd()
(...)

I guess there are another guilty in this scene. I'll keep looking for it. I also guess there's nothing else to check out about sharing a folder with some EXEs and HF Classic DB.

By the way, Guenter, I really don't like to bother anyone. When I need some help, beforehand, I look for over the forum. If there's nothing like my issue, I create a new thread. I'd like to ask you some non-technical questions, but related to the coding job. Perhaps, it would be better to create an off-topic thread in order to ask more people also about these subjects.

Best regards.
gga
Re: [HF Classic] Which is the correct way to use it?
April 04, 2019 02:42PM
The problem may not be your program.
There was a Win7 update in January that caused many network sharing issues. I just spent 3 days trying to solve network locking problems that a client was having. All of their machines run Win7 Pro and share data that exists on a dedicated machine. This all started about 10 days ago. The solution was to apply KB4487345 to all of the machines.
Garry
Re: [HF Classic] Which is the correct way to use it?
April 04, 2019 02:56PM
Thank you! I'll check it out!

I also think that there's no problem in the programs plane. All of them have been working fine for years.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: