diff -r e8f4211554fb -r 5bbf13e885a0 hotspotfw/hsclient/src/hssiaphandler.cpp --- a/hotspotfw/hsclient/src/hssiaphandler.cpp Mon May 24 21:11:39 2010 +0300 +++ b/hotspotfw/hsclient/src/hssiaphandler.cpp Thu May 27 10:28:52 2010 +0300 @@ -30,6 +30,10 @@ #include #include +// CONSTANTS +const TInt KRetryCount = 20; +const TInt KRetryTimeout = 100000; + using namespace CMManager; // ============================ MEMBER FUNCTIONS =============================== @@ -199,9 +203,27 @@ *((CMDBField*)iWLANRecord->GetFieldByIdL(KCDTIdWlanEnableWpaPsk)) = aSettings.iEnableWpaPsk; } } - // now update the access point - iWLANRecord->ModifyL( *dbSession ); + // Update access point, be prepared that Commsdat might be locked + TInt errCode( KErrLocked ); + TInt retryCount( 0 ); + while( errCode == KErrLocked && retryCount < KRetryCount ) + { + TRAP( errCode, iWLANRecord->ModifyL( *dbSession ) ); + + if ( errCode == KErrLocked ) + { + User::After( KRetryTimeout ); + } + retryCount++; + } + + if ( errCode ) + { + // override previous ret value only when error happened + ret = errCode; + } + CleanupStack::PopAndDestroy( dbSession ); DEBUG("CHssIapHandler::ChangeSettingsL DONE"); return ret;