Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 7 Jahren, 2 Monaten
Letzter Beitrag:
vor 7 Jahren, 2 Monaten
Beteiligte Autoren:
Ola, DarrenF, Art Bonds

How to do transaction processing [WD15]?

Startbeitrag von Ola am 08.04.2011 10:09

Hi All

There are a lot of help pages connected to transaction processing, but not a single proper complete example covering a real life multi-user LAN situation where several files are updated (added and/or modified), all possible errors are detected, user is informed of the problem files, items and failure reason, and the whole transaction rolled back automatically in case of any error.

I had no problems whatsoever doing this in my 1980-era Clarion CPD -based DOS system, but Windev is "different" .

I would appreciate seeing a good code example. I am using HFClassic files.

best regards
Ola
http://www.pienoismalli.com

Antworten:

Sorry, my bad.
All is clear, almost "Clarion"-clear. Had a trouble with my own code and solved it out soon after posting. But it always helps to post the problem on the forum:-)

best regards
Ola

von Ola - am 08.04.2011 16:13
Quote
Ola
Sorry, my bad.
All is clear, almost "Clarion"-clear. Had a trouble with my own code and solved it out soon after posting. But it always helps to post the problem on the forum:-)

best regards
Ola


And the solution was...

von Art Bonds - am 09.04.2011 06:37
Quote
But it always helps to post the problem on the forum


Posting the solution is good as well... ;)

von DarrenF - am 11.04.2011 11:20
Hi Guys,

As I said, the solution was to fix my own code:-). But of course I can also post a sample of my standard transaction prosessing. Ill' try to do it later today.

In the meanwhile I am fighting with really weird Windev problems which I absolutely must fix first., see other posts in this forum.

Best regards
Ola

von Ola - am 11.04.2011 12:59
Hi, had a lot of problems and the a bad flu on top of it...

This how I do it:

First check for all possible mandatory fields
and that the data is correct and returntocapture if not

//gTransactionLogFile is a global string holding
//the active database directory and the transactionlogfile //name.
//wTransactionFileList is window-global string listing
//the file labels to include in the transaction
HTransactionStart(gTransactionLogFile,wTransactionFileList)


Move data...
Do_FileOp("FileLabel1","ADD")
//FileOp adds, modifies or deletes a record, and, if additional
//parameters are given, also deletes all the record's child recs.
//Checks for all possible errors, and if any is
//found, calls
//Do_RollZek procedure, which writes the
//error to an errorlog and executes the rollback
//process by calling
//HTransactionCancel() and then shows
//the error text to the user, with key words
//translated to user's language and
//edited to more user friendly form.

Move data... //Gee, how I would like to have here block
//editing capabilities in WD's code editor, and the
//possibility to "paint" characters up and down...
Do_FileOp("FileLabel2","MOD")

HTransactionEnd() //All is OK, commit the transaction

best regards
Ola

von Ola - am 12.04.2011 17:26
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.