DBtransactionData

Top  Previous  Next

Schreiben einer Änderung

Moskito legt zu jedem Workfile *.wf ein Transaktionslog *.tr an. In dieser Datei werden alle Änderungen am Workfile mitgeführt. Sobald eine Transaktion beendet ist, wird das Logfile physisch geschrieben. Nach erfolgreichem Sichern des Workfiles am Ende einer Moskitositzung wird das Logfile entfernt. Trifft Moskito beim Start auf ein vorhandenes Logfile, so ist Moskito zuvor abgebrochen. Und der Workfileinhalt wird anhand der letzten gültigen Transaktion rekonstruiert. Jede Transaktion kann über Zugriffsfunktionen rückgängig gemacht und wiederhergestellt werden.

Jeder Funktion, die ihre Änderungen protokollieren will, braucht diese Funktion, um die Information der Änderungen an das Logfile übergeben zu können. Zwischen den Aufrufen von DBtransactionStart und DBtransactionEnd werden die Funktionen aufgerufen, die Änderungen durchführen. Diese Funktionen müssen die Information an DBtransactionData übergeben, damit sie protokolliert werden.

Parameter

root (PROOT)                                             [IN]

Handle auf die geöffnete Datenbank.

data (void *)                                                 [IN]

data enthält einen Zeiger auf die Struktur, die alle Informationen über die Änderungen enthält. Die Struktur ist jeweils den notwendigen Informationen anzupassen.

Ergebnis

(long int)                                                   [OUT]

Wenn kein Logfile existiert wird 0 zurückgeliefert. Sonst wird die Anzahl der geschriebenen Bytes zurückgeliefert.

Deklaration

#include "database.h"

 

long int DLLENTRY DBtransactionData (

     PROOT    root

);

Verwandte Funktionen

DBtransactionEnd

DBtransactionLevel

DBtransactionStart

DBtransactionRollback

DBtransactionRollforward

DBtransactionSetUndoImpossible

 

 

--------------------OLD_TEXT---------------------

Writings of a change

Moskito puts in to every Workfile *.wf a transaction log *.tr. In this file all changes in the Workfile are carried along. As soon as a transaction is finished, the log file is physically written. After successful securing of the Workfiles at the end of a Moskito's meeting the log file is removed. If Moskito hits by the start on an available log file, Moskito has broken off before. And the Workfileinhalt is reconstructed with the help of the last valid transaction. Every transaction can be cancelled about access functions and be restored.

Of every function which wants to take down her changes this function needs to be able to hand over the information of the changes to the log file. Between the calls of DBtransactionStart and DBtransactionEnd the functions which carry out changes are called. These functions must hand over the information to DBtransactionData, so that they are taken down.

Parametre

root (PROOT) [IN]

Act on the open data bank.

data (void *) [IN]

data contains a pointer on the structure which contains all information about the changes. The structure is to be adapted in each case to the necessary information.

Result

(long int) [OUT]

If no log file is existed 0 zurückgeliefert. But becomes the number of the written bytes zurückgeliefert.

Declaration

#include "database.h"

 

long int DLLENTRY DBtransactionData (

PROOT root

);

Related functions

DBtransactionEnd

DBtransactionLevel

DBtransactionStart

DBtransactionRollback

DBtransactionRollforward

DBtransactionSetUndoImpossible