Differences with SQL Transaction Rollback behaviour for eConnect for Microsoft Dynamics GP 2010

David Meego - Click for blog homepageA recent case has highlighted some subtle differences in behaviour with eConnect for Microsoft Dynamics GP 2010 and the way it handles SQL transaction commit and rollback.

Prior to Microsoft Dynamics GP 2010, if a XML Document file contained any transactions which generated errors from eConnect, the entire Document and all the transactions that have already been processed in it would be rolled back.

With eConnect for Microsoft Dynamics GP, this behaviour has changed under certain circumstances. eConnect now works in one of two ways:

  • Mode 1: Connection String passed external to XML Document
    In this mode, no connection information is passed in the XML Document and SQL transaction contains the entire document. So if an error occurs for any transaction in the document, the entire document will be rolled back.
  • Mode 2: Connection String passed in the XML Document
    In this mode, the <eConnectProcessInfo> node is used just after the TransactionType node to override the externally passed connection string (if passed). When the <eConnectProcessInfo> node is used, once the transaction has been imported without errors and the end of the TransactionType node is reached, the transaction is committed. In this mode, when an error occurs only the current transaction is rolled back as the rest of the previous transactions are already committed.

So what does this mean in a practical sense?

If you are using a "Mode 1" XML document then there is no difference in behaviour.

However, if you are using a "Mode 2" XML document including the <eConnectProcessInfo> node for each transaction and an error occurs, I can't just attempt to re-import the document as all the transaction prior to the one with the error are already imported and will generate duplicate errors.

Note: If you want to restore the previous behaviour to Mode 2, where the entire XML Document will be rolled back if there is an error on any transaction within the document, you can add the ReuseBaseTransaction configuration setting to your application's config file or the Microsoft.Dynamics.GP.eConnect.Service.exe application's config file (Microsoft.Dynamics.GP.eConnect.Service.exe.config). If you change the settings on the service executable, you will will need to restart the service for the change to take effect. The default location for the service files is C:\Program Files\Microsoft Dynamics\eConnect 11.0\Service.

See the example .config below:

     <?xml version="1.0"?>
<add key="ReuseBaseTransaction" value="true"/>

For more information on the changes to eConnect for Microsoft Dynamics GP 2010, please review Chris' post:

Hope this information is useful.