Logo Search packages:      
Sourcecode: maxdb-7.5.00 version File versions

Log_Transaction Class Reference

#include <Log_Transaction.hpp>

List of all members.


Detailed Description

defines a transaction

Definition at line 68 of file Log_Transaction.hpp.


Public Types

enum  LogState { noError, logFull, logError }
 the result of operations, which write to the logVolume More...
enum  RedoResult { redoOk, redoReadError, redoWrongEntry, redoExecuteError }
 the result of a redo-operation More...
enum  RollbackKind { endOfTrans, command, subTrans, illegalRollbackKind }
 the reason for a rollback More...
enum  RollbackResult {
  undoOk, undoNoOpenSubtrans, undoReadError, undoWrongEntry,
  undoExecuteError, undoWriteError, undoLogFull, RollbackResultLastElement
}
 the result of an rollback More...
enum  TransState { opened, committed, rollbacked, illegalTransState }
 state of the transaction More...
enum  TransType { online, redoRead, redoExecute, illegalTransType }
 context, in which the transaction is running More...

Public Member Functions

SAPDBMem_IRawAllocatorAllocator () const
 returns the allocator used by this transaction
void BeginSubtrans ()
 This begins a sub transaction.
void Commit ()
 This TransState becomes committed. And must be open before.
Log_TransactionCopyFromRedoReaderToRedoJobList (const Log_Transaction &srcTrans)
void Delete ()
 this deallocates alle resources allocated by Initialize().
void DeleteAfterRedo ()
 this deallocates alle resources allocated by InitializeForRedo().
void DeleteAfterRedoCopy ()
 this deallocates alle resources allocated by InitializeForRedoCopy().
bool EndSubtrans ()
 This ends a sub transaction.
bool EntriesToRedoExist ()
 returns true, if any redo entry was copied for redo by the transaction.
void GetInfo (Data_PageNo &undoroot, Data_PageNo &undolast, SAPDB_UInt &undopagecount, Log_EntrySequence &lastundosequence)
 returns information about the transaction
Log_EntrySequence GetLastCopiedRedoEntrySequence () const
 used by redo reader to not copy entries, already copied
Log_IOSequenceNo GetOldestKnownIOSequence () const
 returns the oldest known iosequence from the log volume
tgg00_TransContext & GetOldTransContext ()
 this must be used by old interfaces
Log_IOSequenceNo GetRedoEotSequence () const
 used by redo to synchronize a already finished transaction.
const tgg91_TransNo & GetRedoTransNo () const
 used by redo to get the open trans info.
TransState GetTransState () const
 returns one of: open, committed, rollbacked
TransType GetTransType () const
 returns one of: online, redoRead, redoExecute
Data_SplitSpaceWriter GetWriterForLocalRedoEntries (SAPDB_Byte *pActionHead, SAPDB_UInt sizeToReserve)
 returns a split space writer which works on the local redo entry buffer
bool Initialize (tgg00_TransContext &Trans)
 returns true, if no allocation failure.
bool InitializeForRedo (tgg00_TransContext &redoExecuteTrans)
 returns true, if no allocation failure.
bool InitializeForRedoCopy (tgg00_TransContext &redoReaderTrans, const tgg91_TransNo &transNo, SAPDBMem_IRawAllocator &allocator)
 returns true, if no allocation failure.
bool IsInitialized ()
 returns true, if initialized
bool IsInitializedForRedo ()
 true, if initialized
bool IsInitializedForRedoCopy ()
 returns true, if initialized
bool IsOpenInRedo () const
 returns bool true, if it is an open trans not executed by another task.
bool IsRedoRelevant ()
 true, if this transaction entry is needed by redo.
bool IsSavepointRelevant ()
 true, if this transaction needs to be written during savepoint
 Log_Transaction ()
 This is used to create a new write transaction.
void ReadPersistentFormat (const SAPDB_Byte *Space, SAPDB_UInt Length)
 Used for recreating a transaction out of a savepoint file.
RedoResult Redo ()
 The transaction is redone by a redo task.
bool RedoEntriesExist ()
 returns true, if any redo was written by the transaction.
void RedoPartialRollback (Log_EntrySequence UndoStopSequence, Log_EntrySequence RedoStopSequence)
 redo file is truncated and if necessary the UndoFile is partially rollbacked.
void ReleaseSpaceAfterRedoEntryCopy (bool isOK)
Data_SplitSpaceWriter ReserveSpaceForRedoEntryCopy (Data_SplitRecordLength Length, Data_RecordLength MinimalLength, Log_EntrySequence EntrySequence, Log_IOSequenceNo IOSequence)
void ResetLocalRedoEntries ()
 This resets the internal redo entries and empties the buffer.
bool RestoreLocalRedoEntries (Log_IOSequenceNo iosequence)
 During redo copy the local entries are restored and distributed to the redo file.
RollbackResult Rollback (RollbackKind rollbackKind, tgg00_SubtransNo SubtransNo, Log_EntrySequence undoStopSequence=Log_EntrySequence())
 The TransState becomes rollbacked and must be open before.
void SetEOTInRedo (TransState eotState, Log_IOSequenceNo eotSequence)
bool UndoEntriesExist ()
 returns true, if any undo was written by the transaction.
void UpdateUndoRedoInfoForRestart (const Log_IOSequenceNo oldestKnownIOSeq)
bool WasOpenInLastSavepoint ()
void WritePersistentFormat (SAPDB_Byte *Space, SAPDB_UInt Length)
 used for writing the savepoint file
LogState WriteRedoEntry (Log_AfterImage &AfterImage, const Log_IAction &Action)
 The given AfterImage is stored for redo purpose.
void WriteToTrace (const char *Title) const
 writes information about this transaction into the trace.
Log_UndoFile::WriteBeforeImageResult WriteUndoEntry (Log_BeforeImage &BeforeImage, const Log_IAction &Action, Data_PageNo &pageno, Data_PageOffset &offset)
 The given BeforeImage is stored for rollback purpose.

Static Public Member Functions

static void DetermineLocalRedoBufferSize ()
 This reads the paramter LOCAL_REDO_LOG_BUFFER_SIZE and sets local variable.
static void GetDumpInfo (Log_Transaction *pTrans, void *&pData, SAPDB_UInt4 &dataLength)
 this can be used by the locklist to dump with the transentry.
static SAPDB_UInt GetPersistentLength ()
 used for writing the savepoint file

Protected Types

typedef Container_Stack
< SubtransStackElem
SubtransStack
 defines a stack of sub-transactions
typedef struct
Log_Transaction::SubtransStackElem 
SubtransStackElem
 description of a subtransaction

Private Member Functions

void CreateRedoFile (tgg00_TransContext &redoReaderTrans)
 creates an redoFile for this transaction
bool CreateUndoFile ()
 creates an undofile for this transaction
void DropRedoFile ()
 drops the redofile
void DropUndoFile ()
 drops the undofile for this transaction
void EndOfTransHandling (TransState State)
 ends a transaction
void ExecuteRedoAction (Log_AfterImage &AfterImage, Log_IOSequenceNo IOSequence, Data_SplitSpaceReader &Reader, Rst_RedoFile::Iterator &iter, bool &isOK)
 performs an redo-action defined by an afterImage
void ExecuteUndoAction (Log_BeforeImage &BeforeImage, Data_SplitSpaceReader &Reader, Log_UndoFile::Iterator &iter, bool &isOK)
 performs an undo-action defined by an beforeImage
void GiveUndoFileToHistory ()
 the undoFile is unlinked from this transaction and inserted into the history
tgg00_SubtransNo PopUntilSubtransFound (tgg00_SubtransNo SubtransNo, Log_EntrySequence &UndoStopSequence, Log_EntrySequence &RedoStopSequence)
 pops the Subtransstack until a specified is found
void SetTransState (TransState State)
 sets the state of the transaction
void UndoRedoAction (Log_IImage &image, Log_IAction &action, Data_IBreakable &iter, Data_SplitSpaceReader &reader, bool &isOk)
 execute an anction
void UndoRedoContinue (Log_IImage &image, Data_IBreakable &iter, Data_SplitSpaceReader &reader, bool &isOK)
 continue an operation after it has been interrupted
bool WriteEndOfTransEntry (TransState State)
 writes the endOfTransEntry on the log
LogState WritePartialRollbackEntry (Log_EntrySequence UndoStopSequence, Log_EntrySequence RedoStopSequence)
 writes a PartialRollbackEnty on the log

Private Attributes

Persistent m_Context
 the persistent context
Log_ActionMultiple m_LocalRedoEntries
 redo entries which are written as a block to the redo log
tgg00_SubtransNo m_MaxSubtransNo
 maximal used subtrans-number up to now
Log_IOSequenceNo m_OldestKnownIOSequence
 oldest known io sequence, which is used to correctly sort during redo
SAPDBMem_IRawAllocatorm_pAllocator
 the allocator, used for dynamically allocating memory
RTESync_Spinlock m_PersistentAccess
Log_Queuem_pQueue
 the queue used for writing something onto the LogVolume
Rst_RedoFilem_pRedoFile
 currently used redo-file
SubtransStackm_pSubtransStack
 the stack of currently open subtransactions
tgg00_TransContext * m_pTrans
 the old pascal-transaction context
Log_UndoFilem_pUndoFile
 currently used undo-file
TransType m_TransType
 the transactiontype
bool m_WasOpenInLastSavepoint
 true, if this transaction was open in the restart-savepoint

Friends

class Log_OpenTransFile
 the OpenTransfile needs access to the transaction-internals (i.e. persistent structure)

Classes

struct  Persistent
struct  SubtransStackElem
 description of a subtransaction More...

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index