equal
deleted
inserted
replaced
29 #include "mdssqliteconnection.h" |
29 #include "mdssqliteconnection.h" |
30 #include "mdsnamespacedef.h" |
30 #include "mdsnamespacedef.h" |
31 #include "mdcserializationbuffer.h" |
31 #include "mdcserializationbuffer.h" |
32 #include "mdeinternalerror.h" |
32 #include "mdeinternalerror.h" |
33 #include "mdeerror.h" |
33 #include "mdeerror.h" |
|
34 #include "mdscommoninternal.h" |
34 |
35 |
35 // for CleanupResetAndDestroyPushL |
36 // for CleanupResetAndDestroyPushL |
36 #include <mmf/common/mmfcontrollerpluginresolver.h> |
37 #include <mmf/common/mmfcontrollerpluginresolver.h> |
37 |
38 |
38 __USES_LOGGER |
39 __USES_LOGGER |
166 TRAPD( err, id = iManipulate->AddObjectL( connection, aBuffer, |
167 TRAPD( err, id = iManipulate->AddObjectL( connection, aBuffer, |
167 baseObjStmt, objStmt, aServerSession ) ); |
168 baseObjStmt, objStmt, aServerSession ) ); |
168 if (err == KErrNone) |
169 if (err == KErrNone) |
169 { |
170 { |
170 aResultBuffer.InsertL( id ); |
171 aResultBuffer.InsertL( id ); |
|
172 iAddedObjectsCount++; |
171 } |
173 } |
172 else |
174 else |
173 { |
175 { |
174 aResultBuffer.InsertL( KNoId ); |
176 aResultBuffer.InsertL( KNoId ); |
175 if(resultIds.iErrorCode == KErrNone) |
177 if(resultIds.iErrorCode == KErrNone) |
293 aResultBuffer.PositionL( KNoOffset ); |
295 aResultBuffer.PositionL( KNoOffset ); |
294 resultIds.SerializeL( aResultBuffer ); |
296 resultIds.SerializeL( aResultBuffer ); |
295 |
297 |
296 iManipulate->SetNamespace( NULL ); |
298 iManipulate->SetNamespace( NULL ); |
297 iNotifier.NotifyAddedL( aBuffer, aResultBuffer ); |
299 iNotifier.NotifyAddedL( aBuffer, aResultBuffer ); |
|
300 |
|
301 if( iAddedObjectsCount > KTriggerDbMaintenanceTreasholdValue ) |
|
302 { |
|
303 RMdSTransaction transaction( connection ); |
|
304 CleanupClosePushL(transaction); |
|
305 const TInt beginError( transaction.Error() ); |
|
306 |
|
307 if( beginError != KErrNone ) |
|
308 { |
|
309 CleanupStack::PopAndDestroy( &transaction ); |
|
310 } |
|
311 |
|
312 iManipulate->AnalyzeL(); |
|
313 |
|
314 if( beginError == KErrNone ) |
|
315 { |
|
316 transaction.CommitL(); |
|
317 CleanupStack::PopAndDestroy( &transaction ); |
|
318 } |
|
319 |
|
320 iAddedObjectsCount = 0; |
|
321 } |
298 } |
322 } |
299 |
323 |
300 // --------------------------------------------------------------------------- |
324 // --------------------------------------------------------------------------- |
301 // RemoveL |
325 // RemoveL |
302 // --------------------------------------------------------------------------- |
326 // --------------------------------------------------------------------------- |
603 TItemId id = KNoId; |
627 TItemId id = KNoId; |
604 TRAPD( err, id = iManipulate->UpdateObjectL( connection, aBuffer ) ); |
628 TRAPD( err, id = iManipulate->UpdateObjectL( connection, aBuffer ) ); |
605 if (err == KErrNone) |
629 if (err == KErrNone) |
606 { |
630 { |
607 aResultBuffer.InsertL( id ); |
631 aResultBuffer.InsertL( id ); |
|
632 iModifiedObjectsCount++; |
608 } |
633 } |
609 else |
634 else |
610 { |
635 { |
611 aResultBuffer.InsertL( KNoId ); |
636 aResultBuffer.InsertL( KNoId ); |
612 if ( resultIds.iErrorCode == KErrNone ) |
637 if ( resultIds.iErrorCode == KErrNone ) |
687 // set up result header |
712 // set up result header |
688 aResultBuffer.PositionL( KNoOffset ); |
713 aResultBuffer.PositionL( KNoOffset ); |
689 resultIds.SerializeL( aResultBuffer ); |
714 resultIds.SerializeL( aResultBuffer ); |
690 |
715 |
691 iNotifier.NotifyModifiedL( aBuffer, aResultBuffer ); |
716 iNotifier.NotifyModifiedL( aBuffer, aResultBuffer ); |
|
717 |
|
718 if( iModifiedObjectsCount > KTriggerDbMaintenanceTreasholdValue ) |
|
719 { |
|
720 RMdSTransaction transaction( connection ); |
|
721 CleanupClosePushL(transaction); |
|
722 const TInt beginError( transaction.Error() ); |
|
723 |
|
724 if( beginError != KErrNone ) |
|
725 { |
|
726 CleanupStack::PopAndDestroy( &transaction ); |
|
727 } |
|
728 |
|
729 iManipulate->AnalyzeL(); |
|
730 |
|
731 if( beginError == KErrNone ) |
|
732 { |
|
733 transaction.CommitL(); |
|
734 CleanupStack::PopAndDestroy( &transaction ); |
|
735 } |
|
736 |
|
737 iModifiedObjectsCount = 0; |
|
738 } |
692 } |
739 } |
693 |
740 |
694 CMdCSerializationBuffer* CMdSManipulationEngine::CheckObjectL( |
741 CMdCSerializationBuffer* CMdSManipulationEngine::CheckObjectL( |
695 TInt aResultBufferSize, const TDesC& aUri, TDefId aNamespaceDefId ) |
742 TInt aResultBufferSize, const TDesC& aUri, TDefId aNamespaceDefId ) |
696 { |
743 { |