I'm developing an ArcMap addin with ArcObjects 10.3.1 SDK that needs to have an active edit session to work.
It creates new rows after a check process and stores them in a datatable into a file Geodatabase.
Like that:
// Initialize new row
errorRow = errorsTable.CreateRow();
// Fill row
...
// Commiting the new feature storage
errorRow.Store();
// Iterate over all check results then save edit session
((IWorkspaceEdit)m_featureWorkspace).StopEditing(true);
((IWorkspaceEdit)m_featureWorkspace).StartEditing(true);
My problem is I don't want the addin to rely on a programmatical save edits, since the user might be running other processes at this same edit session.
I then tried to use the method ExecuteSQL
from IWorkspace
interface in hopes it would turn to be a direct insertion bypassing the edit session, but with no avail.
string sqlStatement = string.Format(new
System.Globalization.CultureInfo("en-US"), "INSERT INTO {0} VALUES (...);", ...);
((IWorkspace)m_featureWorkspace).ExecuteSQL(sqlStatement);
// Needs a save edits
((IWorkspaceEdit)m_featureWorkspace).StopEditing(true);
((IWorkspaceEdit)m_featureWorkspace).StartEditing(true);
Is there any way to programatically bypass an active edit session to insert rows into the database without having to mandatorily save a whole active edit session?