inc/mdssqliteconnection.h
branchRCL_3
changeset 63 e538444823de
parent 47 b73252188534
--- a/inc/mdssqliteconnection.h	Wed Sep 15 12:40:59 2010 +0300
+++ b/inc/mdssqliteconnection.h	Wed Oct 13 15:02:02 2010 +0300
@@ -237,15 +237,11 @@
 
         /**
         * cleanup method (from TBase)
-        * according to status does Rollback or nothing if commit was succesfull
+        * according to status does Commit/Rollback/nothing
         */
         inline void Close()
             {
-            // Internal error state is KErrNone if the transaction could be created successfully,
-            // and the state is resetted if the transaction is committed succesfully. Only if the
-            // transaction is started succesfully but not committed, it needs to be rolled back
-            // to close the ongoing transaction
-            if ( iErrorState == KErrNone )
+            if ( iErrorState != KErrNone )
                 {
                 TRAP( iErrorState, iConnection.TransactionRollbackL() );
                 }
@@ -263,6 +259,17 @@
             }
 
         /**
+        * Rolls back the transaction explicitly
+        * - possibility to receive leave
+        * eliminates actions on destructor.
+        */
+        inline void RollbackL()
+            {
+            iConnection.TransactionRollbackL();
+            Reset();
+            }
+
+        /**
         * Resets the transaction
         * (does not commit or rollback or do anything)
         */