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


David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

A 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 DocumentIn 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 DocumentIn 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 FilesMicrosoft DynamicseConnect 11.0Service.

See the example .config below:

<?xml version=”1.0″?>
<configuration>
<appSettings>
<add key=”ReuseBaseTransaction” value=”true”/>
</appSettings>
</configuration>

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

Hope this information is useful.

David

This article was originally posted on the Developing for Dynamics GP Blog and has been reposted on http://www.winthropdc.com/blog.

3 thoughts on “Differences with SQL Transaction Rollback behaviour for eConnect for Microsoft Dynamics GP 2010

  1. I was wondering if there was a typo in the BLOG at the text "Note: If you want to restore the previous behaviour to Mode 2, ".  Did you possibly mean Mode 1 instead?  

    Like

  2. Hi Dave.
    Thanks for the feedback.
    The note is correct. You can restore the previous rollback behavior even when including connection data in the XML document (mode 2).
    David

    Like

Please post feedback or comments

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.