metadataengine/server/src/mdssqliteconnection.cpp
branchRCL_3
changeset 19 b73252188534
parent 13 4a4892eec172
equal deleted inserted replaced
18:63c982fb92f2 19:b73252188534
    46 CMdSSqLiteConnection::~CMdSSqLiteConnection()
    46 CMdSSqLiteConnection::~CMdSSqLiteConnection()
    47     {
    47     {
    48     CloseDb();
    48     CloseDb();
    49 
    49 
    50     delete iDbFileName;
    50     delete iDbFileName;
       
    51     iDbFileName = NULL;    
    51 
    52 
    52     iNotFinishFindQuery = NULL;
    53     iNotFinishFindQuery = NULL;
    53     }
    54     }
    54 
    55 
    55 void CMdSSqLiteConnection::DeleteDb( TDesC16* aName )
    56 void CMdSSqLiteConnection::DeleteDb( TDesC16* aName )
   541     CleanupClosePushL( emptyRow );
   542     CleanupClosePushL( emptyRow );
   542     TRAPD( err, ExecuteL(KBeginTransaction, emptyRow) );
   543     TRAPD( err, ExecuteL(KBeginTransaction, emptyRow) );
   543     if (err != KErrNone)
   544     if (err != KErrNone)
   544     	{
   545     	{
   545     	_LIT( KMdsTransactionBegin, "Transaction begin error" );
   546     	_LIT( KMdsTransactionBegin, "Transaction begin error" );
       
   547         if( !iNotFinishFindQuery )
       
   548             {
       
   549             iEnableTransaction = ETrue;
       
   550             }
       
   551         iTransactionOngoing = EFalse;
   546     	TraceAndLeaveL( KMdsTransactionBegin, err );
   552     	TraceAndLeaveL( KMdsTransactionBegin, err );
   547     	}
   553     	}
   548 	CleanupStack::PopAndDestroy( &emptyRow );
   554 	CleanupStack::PopAndDestroy( &emptyRow );
   549     }
   555     }
   550 
   556 
   579         }
   585         }
   580     _LIT(KRollback, "ROLLBACK;");
   586     _LIT(KRollback, "ROLLBACK;");
   581     RRowData emptyRow;
   587     RRowData emptyRow;
   582     CleanupClosePushL( emptyRow );
   588     CleanupClosePushL( emptyRow );
   583     TRAPD( err, ExecuteL(KRollback, emptyRow) );
   589     TRAPD( err, ExecuteL(KRollback, emptyRow) );
       
   590     if (err != KErrNone)
       
   591         {
       
   592         _LIT( KMdsTransactionRollback, "Transaction rollback error" );
       
   593         TraceAndLeaveL( KMdsTransactionRollback, err );
       
   594         }    
   584     if( !iNotFinishFindQuery )
   595     if( !iNotFinishFindQuery )
   585         {
   596         {
   586         iEnableTransaction = ETrue;
   597         iEnableTransaction = ETrue;
   587         }
   598         }
   588     iTransactionOngoing = EFalse;
   599     iTransactionOngoing = EFalse;
   589     if (err != KErrNone)
       
   590     	{
       
   591     	_LIT( KMdsTransactionRollback, "Transaction rollback error" );
       
   592     	TraceAndLeaveL( KMdsTransactionRollback, err );
       
   593     	}
       
   594 	CleanupStack::PopAndDestroy( &emptyRow );
   600 	CleanupStack::PopAndDestroy( &emptyRow );
   595     }
   601     }
   596 
   602 
   597 #ifdef _DEBUG
   603 #ifdef _DEBUG
   598 void CMdSSqLiteConnection::TraceAndLeaveL( const TDesC& aFailedCommand, TInt aSqliteError )
   604 void CMdSSqLiteConnection::TraceAndLeaveL( const TDesC& aFailedCommand, TInt aSqliteError )