os/persistentdata/loggingservices/eventlogger/LogServ/src/LogServDatabaseTransactionInterface.cpp
First public contribution.
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "LogServDatabaseTransactionInterface.h"
19 /////////////////////////////////////////////////////////////////////////////////////////
20 // -----> MLogServDatabaseTransactionInterface (source)
21 /////////////////////////////////////////////////////////////////////////////////////////
23 void MLogServDatabaseTransactionInterface::DTIBeginWithRollBackProtectionLC()
25 const TInt error = DTIBegin();
26 User::LeaveIfError(error);
27 CleanupStack::PushL(TCleanupItem(RollBackDatabase, this));
30 void MLogServDatabaseTransactionInterface::DTICommitAndCancelRollbackProtectionL()
32 const TInt error = DTICommitAndEnd();
33 User::LeaveIfError(error);
34 CleanupStack::Pop(); // Roll back item
37 void MLogServDatabaseTransactionInterface::RollBackDatabase(TAny* aObject)
39 MLogServDatabaseTransactionInterface* self = reinterpret_cast<MLogServDatabaseTransactionInterface*>(aObject);