os/persistentdata/loggingservices/eventlogger/LogServ/src/LogServDatabaseTransactionInterface.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #include "LogServDatabaseTransactionInterface.h"
    17 
    18 
    19 /////////////////////////////////////////////////////////////////////////////////////////
    20 // -----> MLogServDatabaseTransactionInterface (source)
    21 /////////////////////////////////////////////////////////////////////////////////////////
    22 
    23 void MLogServDatabaseTransactionInterface::DTIBeginWithRollBackProtectionLC()
    24 	{
    25 	const TInt error = DTIBegin();
    26 	User::LeaveIfError(error);
    27 	CleanupStack::PushL(TCleanupItem(RollBackDatabase, this));
    28 	}
    29 	
    30 void MLogServDatabaseTransactionInterface::DTICommitAndCancelRollbackProtectionL()
    31 	{
    32 	const TInt error = DTICommitAndEnd();
    33 	User::LeaveIfError(error);
    34 	CleanupStack::Pop(); // Roll back item
    35 	}
    36 
    37 void MLogServDatabaseTransactionInterface::RollBackDatabase(TAny* aObject)
    38 	{
    39 	MLogServDatabaseTransactionInterface* self = reinterpret_cast<MLogServDatabaseTransactionInterface*>(aObject);
    40 	self->DTIRollBack();
    41 	}