diff -r a003f0e60a07 -r e4420734a2a0 realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp --- a/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp Fri Sep 03 14:18:25 2010 +0300 +++ b/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp Tue Oct 19 05:33:24 2010 +0530 @@ -579,9 +579,6 @@ CMDBSession* db = CMDBSession::NewL( KCDVersion1_1 ); CleanupStack::PushL( db ); - db->OpenTransactionL(); - CleanupStack::PushL(TCleanupItem(RollBackDBTransaction, db)); - // Set attributes so that also protected iaps can be accessed db->SetAttributeMask( ECDHidden | ECDProtectedWrite ); @@ -592,8 +589,6 @@ CleanupStack::PushL( iapRecord ); iapRecord->SetRecordId( iIapId ); - - TBool clearedProtectedIap = ClearProtectedRecord( *iapRecord ); iapRecord->LoadL( *db ); @@ -615,8 +610,6 @@ CCDOutgoingGprsRecord* serviceRecord = static_cast( iapRecord->iService.iLinkedRecord ); - - TBool clearedProtectedService = ClearProtectedRecord( *serviceRecord ); PROFILE_DEBUG6( "CSIPApnConfigurationHandler::ChangeApnL() curr apn", @@ -637,30 +630,17 @@ PROFILE_DEBUG3( "CSIPApnConfigurationHandler::ChangeApnL() new security", aUseSecureAuthentication ) - - serviceRecord->ModifyL( *db ); - - if ( clearedProtectedIap ) + + TRAPD(err, serviceRecord->ModifyL( *db )); + if (err != KErrNone) { - // Set protection back - iapRecord->SetAttributes( ECDProtectedWrite ); - iapRecord->ModifyL( *db ); - } + PROFILE_DEBUG3( "CSIPApnConfigurationHandler::ChangeApnL,ModifyL leaves",err ) + User::Leave(err); + } - if ( clearedProtectedService ) - { - // Set protection back - serviceRecord->SetAttributes( ECDProtectedWrite ); - serviceRecord->ModifyL( *db ); - } - db->ClearAttributeMask( ECDHidden | ECDProtectedWrite ); CleanupStack::PopAndDestroy( iapRecord ); - - db->CommitTransactionL(); - - CleanupStack::Pop(); //cleanup item CleanupStack::PopAndDestroy( db ); @@ -676,22 +656,6 @@ } // ----------------------------------------------------------------------------- -// CSIPApnConfigurationHandler::ClearProtectedRecord -// ----------------------------------------------------------------------------- -// -TBool CSIPApnConfigurationHandler::ClearProtectedRecord( - CommsDat::CCDRecordBase& aRecord ) - { - TBool cleared( EFalse ); - if ( aRecord.IsSetAttribute( CommsDat::ECDProtectedWrite ) ) - { - aRecord.ClearAttributes( CommsDat::ECDProtectedWrite ); - cleared = ETrue; - } - return cleared; - } - -// ----------------------------------------------------------------------------- // CSIPApnConfigurationHandler::SetMonitoringState // ----------------------------------------------------------------------------- // @@ -936,14 +900,4 @@ PROFILE_DEBUG1("DatabaseMonitoringCompletedL::AllowCellularDataUsage Exit" ); } -// ----------------------------------------------------------------------------- -// CSIPApnConfigurationHandler::RollBackDBTransaction -// ----------------------------------------------------------------------------- -// -void CSIPApnConfigurationHandler::RollBackDBTransaction(TAny* aDb) - { - CMDBSession* db = static_cast(aDb); - TRAP_IGNORE(db->RollbackTransactionL()); - } - // End of file