[chronojump] fix on: At export ensure encoder trigger from unwanted sessions is deleted



commit ac8d21af31d2cac8b13568342e8de15e7c438570
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Sep 3 16:41:55 2020 +0200

    fix on: At export ensure encoder trigger from unwanted sessions is deleted

 src/sqlite/session.cs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/sqlite/session.cs b/src/sqlite/session.cs
index a2a6825f..202d0ccf 100644
--- a/src/sqlite/session.cs
+++ b/src/sqlite/session.cs
@@ -970,7 +970,7 @@ class SqliteSession : Sqlite
 
                /*
                 * on export we only want to delete SQL stuff, because files of other sessions will not be 
copied
-                * but note if we want to call some other SQL method, we need to take care to pass dbcon or 
dbcmd
+                * but note we use dbcmd, if we want to call some other SQL method, we need to take care to 
pass dbcon or dbcmd
                 */
                if(export)
                {
@@ -996,7 +996,12 @@ class SqliteSession : Sqlite
                                dbcmd.ExecuteNonQuery();
 
                                // delete related triggers
-                               SqliteTrigger.DeleteByModeID(true, Convert.ToInt32(signal));
+                               //SqliteTrigger.DeleteByModeID(true, Convert.ToInt32(signal));
+                               //to export we have to do it with the dbcmd:
+                               dbcmd.CommandText = "Delete FROM " + Constants.TriggerTable +
+                                       " WHERE modeID = " + Convert.ToInt32(signal);
+                               LogB.SQL(dbcmd.CommandText.ToString());
+                               dbcmd.ExecuteNonQuery();
                        }
 
                        // 3 delete all encoder table stuff (signals and curves)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]