Kexi API Documentation (2.0 alpha)

KexiDB::TransactionGuard Class Reference

#include <transaction.h>

List of all members.


Detailed Description

Helper class for using inside methods for given connection.

It can be used in two ways:

Definition at line 119 of file transaction.h.

Public Member Functions

 TransactionGuard (Connection &conn)
 TransactionGuard (const Transaction &trans)
 TransactionGuard ()
 ~TransactionGuard ()
void setTransaction (const Transaction &trans)
bool commit ()
void doNothing ()
const Transaction transaction () const

Protected Attributes

Transaction m_trans
bool m_doNothing: 1


Constructor & Destructor Documentation

TransactionGuard::TransactionGuard Connection conn  ) 
 

Constructor #1: Starts new transaction constructor for connection. Started transaction handle is available via transaction().

Definition at line 130 of file transaction.cpp.

TransactionGuard::TransactionGuard const Transaction trans  ) 
 

Constructor #2: Uses already started transaction.

Definition at line 136 of file transaction.cpp.

TransactionGuard::TransactionGuard  ) 
 

Constructor #3: Creates TransactionGuard without transaction assinged. setTransaction() can be used later to do so.

Definition at line 142 of file transaction.cpp.

TransactionGuard::~TransactionGuard  ) 
 

Rollbacks not committed transaction.

Definition at line 147 of file transaction.cpp.

References KexiDB::Transaction::active(), KexiDB::Transaction::connection(), m_doNothing, and m_trans.


Member Function Documentation

bool TransactionGuard::commit  ) 
 

Comits the guarded transaction. It is convenient shortcut to connection->commitTransaction(this->transaction())

Definition at line 153 of file transaction.cpp.

References KexiDB::Transaction::active(), KexiDB::Transaction::connection(), and m_trans.

Referenced by KexiCSVImportDialog::accept(), KexiProject::createInternalStructures(), KexiProject::removeObject(), KexiProject::renameObject(), and KexiDialogBase::storeData().

void TransactionGuard::doNothing  ) 
 

Makes guarded transaction not guarded, so nothing will be performed on guard's desctruction.

Definition at line 161 of file transaction.cpp.

References m_doNothing.

Referenced by KexiDB::Connection::beginAutoCommitTransaction().

void KexiDB::TransactionGuard::setTransaction const Transaction trans  )  [inline]
 

Assigns transaction trans to this guard. Previously assigned transaction will be unassigned from this guard.

Definition at line 138 of file transaction.h.

Referenced by KexiDB::Connection::beginAutoCommitTransaction(), and KexiProject::createInternalStructures().

const Transaction KexiDB::TransactionGuard::transaction  )  const [inline]
 

Transaction that are controlled by this guard.

Definition at line 148 of file transaction.h.

Referenced by KexiDB::Connection::alterTableName(), KexiProject::createInternalStructures(), KexiDB::Connection::createTable(), KexiDB::Connection::dropQuery(), KexiDB::Connection::dropTable(), KexiProject::removeObject(), and KexiProject::renameObject().


Member Data Documentation

bool KexiDB::TransactionGuard::m_doNothing [protected]
 

Definition at line 152 of file transaction.h.

Referenced by doNothing(), and ~TransactionGuard().

Transaction KexiDB::TransactionGuard::m_trans [protected]
 

Definition at line 151 of file transaction.h.

Referenced by commit(), and ~TransactionGuard().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:49 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003