metadataengine/server/src/mdsmanipulationengine.cpp
changeset 43 c5e73110f733
parent 40 910a23996aa0
child 48 1389872e7c51
--- a/metadataengine/server/src/mdsmanipulationengine.cpp	Fri Jul 23 10:03:59 2010 +0300
+++ b/metadataengine/server/src/mdsmanipulationengine.cpp	Fri Aug 06 09:56:02 2010 +0300
@@ -155,7 +155,7 @@
         CleanupClosePushL(objStmt);
 		
         RMdSTransaction transaction( connection );
-        CleanupClosePushL(transaction);
+        CleanupClosePushL (transaction );
         const TInt beginError( transaction.Error() );
         if( beginError != KErrNone )
             {
@@ -1074,13 +1074,19 @@
     CMdSSqLiteConnection& connection = MMdSDbConnectionPool::GetDefaultDBL();
     RMdSTransaction transaction( connection );
     CleanupClosePushL( transaction );
-    User::LeaveIfError( transaction.Error() );
+    const TInt beginError( transaction.Error() );
+    if( beginError != KErrNone )
+        {
+        CleanupStack::PopAndDestroy( &transaction );
+        }
     
     iManipulate->CheckMassStorageMediaIdL( aMediaId );
     
-    transaction.CommitL();
-
-    CleanupStack::PopAndDestroy( &transaction );
+    if( beginError == KErrNone )
+        {
+        transaction.CommitL();
+        CleanupStack::PopAndDestroy( &transaction );
+        }
     }
 
 void CMdSManipulationEngine::AddRelationDefL( TDefId aNamespaceId, const TDesC& aRelationDefName )