Developing for Dynamics GP

by David Musgrave (Perth, WA, Australia) and the Microsoft Dynamics GP Developer Support Team (Fargo, ND, USA)

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

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

Rate This
  • Comments 3

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"?>
     <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

  • 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?  

  • 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

  • Posting from Mark Polino at DynamicAccounting.net

    msdynamicsgp.blogspot.com.au/.../differences-with-sql-transaction.html

Page 1 of 1 (3 items)
Comments Information

PLEASE READ BEFORE POSTING

Please only post comments relating to the topic of this page.

If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.

Leave a Comment
  • Please add 4 and 1 and type the answer here:
  • Post