inc/mdssqliteconnection.h
changeset 43 c5e73110f733
parent 28 c461c7fa72c2
child 63 e538444823de
equal deleted inserted replaced
40:910a23996aa0 43:c5e73110f733
   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 Commit/Rollback/nothing
   240         * according to status does Rollback or nothing if commit was succesfull
   241         */
   241         */
   242         inline void Close()
   242         inline void Close()
   243             {
   243             {
   244             if ( iErrorState != KErrNone )
   244             // Internal error state is KErrNone if the transaction could be created successfully,
       
   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 )
   245                 {
   249                 {
   246                 TRAP( iErrorState, iConnection.TransactionRollbackL() );
   250                 TRAP( iErrorState, iConnection.TransactionRollbackL() );
   247                 }
   251                 }
   248             }
   252             }
   249 
   253 
   253         * eliminates actions on destructor.
   257         * eliminates actions on destructor.
   254         */
   258         */
   255         inline void CommitL()
   259         inline void CommitL()
   256             {
   260             {
   257             iConnection.TransactionCommitL();
   261             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();
       
   269             Reset();
   262             Reset();
   270             }
   263             }
   271 
   264 
   272         /**
   265         /**
   273         * Resets the transaction
   266         * Resets the transaction