inc/mdssqliteconnection.h
branchRCL_3
changeset 63 e538444823de
parent 47 b73252188534
equal deleted inserted replaced
57:2872ae438bf7 63:e538444823de
   235             TRAP( iErrorState, iConnection.TransactionBeginL() );
   235             TRAP( iErrorState, iConnection.TransactionBeginL() );
   236             }
   236             }
   237 
   237 
   238         /**
   238         /**
   239         * cleanup method (from TBase)
   239         * cleanup method (from TBase)
   240         * according to status does Rollback or nothing if commit was succesfull
   240         * according to status does Commit/Rollback/nothing
   241         */
   241         */
   242         inline void Close()
   242         inline void Close()
   243             {
   243             {
   244             // Internal error state is KErrNone if the transaction could be created successfully,
   244             if ( iErrorState != KErrNone )
   245             // and the state is resetted if the transaction is committed succesfully. Only if the
       
   246             // transaction is started succesfully but not committed, it needs to be rolled back
       
   247             // to close the ongoing transaction
       
   248             if ( iErrorState == KErrNone )
       
   249                 {
   245                 {
   250                 TRAP( iErrorState, iConnection.TransactionRollbackL() );
   246                 TRAP( iErrorState, iConnection.TransactionRollbackL() );
   251                 }
   247                 }
   252             }
   248             }
   253 
   249 
   257         * eliminates actions on destructor.
   253         * eliminates actions on destructor.
   258         */
   254         */
   259         inline void CommitL()
   255         inline void CommitL()
   260             {
   256             {
   261             iConnection.TransactionCommitL();
   257             iConnection.TransactionCommitL();
       
   258             Reset();
       
   259             }
       
   260 
       
   261         /**
       
   262         * Rolls back the transaction explicitly
       
   263         * - possibility to receive leave
       
   264         * eliminates actions on destructor.
       
   265         */
       
   266         inline void RollbackL()
       
   267             {
       
   268             iConnection.TransactionRollbackL();
   262             Reset();
   269             Reset();
   263             }
   270             }
   264 
   271 
   265         /**
   272         /**
   266         * Resets the transaction
   273         * Resets the transaction