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