Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 4 Jahren, 6 Monaten
Letzter Beitrag:
vor 4 Jahren, 6 Monaten
Beteiligte Autoren:
Ola, Stefan Bentvelsen

How to cancel a transaction containing protected files?

Startbeitrag von Ola am 12.10.2013 18:04

Situation:
WD16, HyperFileSQL Classic.

I thought I have the transaction management under control, but obviously not. A funny thing happened:

1. Maintaining a contact record in a form.
2. Clicking a button which opens a pop-up menu to choose some actions - nothing to do with any transaction what so ever, so far. Nothing touched except the button: The form goes milky white and stays that way several minutes, until the program is finally manually closed from the Task manager.

3. Trying to re-start the program, which tries to cancel any interrupted transaction during its initialization:

Error at line 23 of Global Procedure Zek_TransactionLog process.
HTransactionCancel function called.
Unable to cancel transaction.
Wrong password for file.

What the h... Does HTransactionCancel need to know the passwords of protected files? There is nothing mentioned about this in the documentation!

However, this PARAM.FIC is a protected parameter file, and when I view the transaction file using the WDTrans utility, it actually does require the passwords for the protected files!

Is it really so, that HTransactionCancel only works with unprotected files, and if there are protected files in the failed transaction, then the transaction must be cancelled using WDTrans?

Can somebody shed some light on this?

That was the first weird thing. There two more:

2. Another thing is that why on earth did WD start the transaction in the first place. I don't even want to guess -- mayby Jupiter just wasn't aligned correctly with Mars... And furthermore, this parameter file especially is not normally updated in any transaction launched outside its own maintenance form...

3. Also, how can I automate the fixing of this kind of problem? That is, how to programmatically cancel a transaction that contains not only unprotected files, but also protected files, possibly several of them with different passwords? WDTrans can be called from the code, but it only accepts the name of the transaction file (TRX) as a parameter, not a file-specific TRX-file?!?!?

Or have I just missed something basic here?

best regards
Ola

Antworten:

Hi Ola,

may be you can use HPass() for the protected files, before executing the HCancelTransaction() ?

von Stefan Bentvelsen - am 12.10.2013 18:27
Thanks Stefan, but HPass does not seem to help with HCancelTransaction().

I think I found the reason, at least partially, why the transaction started: it was obviously a weird combination of "impossible" data in an old, imported record and my code. I can fix this.

But I am still flabbergasted about how to programmatically cancel a transaction that contains files with more than one password??? I can cancel it using WDTrans, where the password can be given separately for each file in the transaction, but I just cannot do it programmatically.

Does anybody know the solution?

Best regards
Ola

von Ola - am 14.10.2013 11:48
Hi again

Found the problem. HTransactionCancel works ok even with different passwords, but all files belonging to the transaction must be open.

I had opened all the files with passwords (with HPass like Stefan said) but I had not opened one of the non-protected filed and that caused the problem.

Sorry for unnecessary noise.

Best regards
Ola

von Ola - am 16.10.2013 21:23
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.