diff -r dbe86d96ce5b -r 2dc6da6fb431 hotspotfw/hsclient/src/hssiaphandler.cpp --- a/hotspotfw/hsclient/src/hssiaphandler.cpp Thu May 27 13:59:00 2010 +0300 +++ b/hotspotfw/hsclient/src/hssiaphandler.cpp Fri Jun 11 14:43:07 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;