Microsoft Dynamics GP Developing for Dynamics GP
A blog dedicated to the Microsoft Dynamics GP Developer & Consultant community
 
Welcome to MSDN Blogs Sign in | Join | Help

Developing for Dynamics GP

by David Musgrave (Australia) and the Microsoft Dynamics GP Developer Support Team (USA)

News

  • Please use the Blog Feedback? - Contact Us link at the top of the page to email questions relating to the blog itself.

    If you wish to ask a technical question, please use the links below to ask on the Newsgroups. If you ask on the Newsgroups, others in the community can respond and the answers are available for everyone in the future.

    Please do not use comments on pages and posts to ask questions unrelated to the topic on that page or post.



    Dates of Interest:

    11-Jul-2008: Blog Created by David Musgrave.
    10-Oct-2008: First Post by Scott Stephenson.
    04-Nov-2008: First Post by Dave Dusek.
    11-Nov-2008: First Post by Beth Gardner.
    28-Nov-2008: First Post by Chris Roehrich.
    30-Dec-2008: First Post by Patrick Roth.
    24-Feb-2009: First Post by Greg Willson.
    22-Apr-2009: First Post by David Clauson.
    04-May-2009: First Post by Ryan Wigestrand.
    19-Jun-2009: First Post by Dawn Langlie.
    03-Jul-2009: First Post by Emily Halvorson.
    23-Sep-2009: Created Twitter account with blog feed.



    WorldMaps Statistics since
    24-Feb-2009:




    Click for WorldMaps Stumbler



    Translator Tool:




    Social Networking

    Follow David Musgrave and the blog on:

    David Musgrave on Twitter

    David Musgrave on LinkedIn


    Disclaimer

    This blog is provided "AS IS" with no warranties, and confers no rights.

    The links in this blog may lead to third-party Web sites. Microsoft provides third-party resources to help you find customer service and/or technical support resources. Information at these sites may change without notice. Microsoft is not responsible for the content at any third-party Web sites and does not guarantee the accuracy of third-party information.

Contents

Favourite Posts

Blog Links

Newsgroups Links

Resources Links

Web Services Configuration Settings for Integrating Large Transactions

Chris Roehrich It is definitely possible to use Web Services for Microsoft Dynamics GP to create large transactions. By large transactions I am referring to examples of where a sales invoice would have several thousands of lines on it.  That's right, some companies are integrating transactions this large using our Web Services for Dynamics GP!

I had a recent support case where a business requirement was to create a sales invoice with 20,000 lines on it. The eConnect XML string that Web Services ultimately creates will be very large and several minutes can go by in this case.  Depending on hardware and the environment it could take an hour for a transaction of that size to complete.  This XML string is passed to the eConnect .Net API where the Microsoft Distributed Transaction Coordinator (MSDTC) is used to communicate with the SQL server and make sure it runs in one transaction. This is where the MSDTC timeout settings and other timeout values in the configuration files come into play. If the settings are not used the transaction will timeout from MSDTC and any eConnect stored procedures that have updated the database will rollback.

It's important to know that transactions of this size are not necessarily recommended when compared to the other option of sending in many smaller transactions with less lines associated to them.   A smaller XML document will process faster.   SQL locks associated to tables like the SY01500 and IV00102 tables will be let go quicker on smaller transactions.   So sending in large transactions takes some consideration as to when to do it.      

You may see one or more of the below errors in the Web Services Exception Console, eConnect Event Log, or the custom application using the Web Services when a timeout situation happens:

Microsoft Distributed Transaction Coordinator (MSDTC) has cancelled the transaction.
The operation has timed out.
Thread was aborted.
The operation is not valid for the state of the transaction.

To avoid these timeout errors, use the following strategy by making the changes below:

1. On the Web Services computer, set the MSDTC global transaction timeout value to 0. Make sure the eConnect COM+ application components Microsoft.Dynamics.GP.eConnect.eConnectInternalMiscMethods and Microsoft.Dynamics.GP.eConnect.eConnectMethods do not override it.

a. Go to Administrative Tools-Components Services-Expand My Computers and right click on My Computer and choose Properties. Set the Transaction Timeout field to 0.

b. Expand My Computer - COM+ Applications - eConnect 10 for Microsoft Dynamics GP - Components and right click on the Microsoft.Dynamics.GP.eConnect.eConnectInternalMiscMethods and choose Properties. Make sure the Override global transaction timeout value is not marked under the Transactions tab. Do the same for the Microsoft Dynamics.GP.eConnect.eConnectMethods component.

2. Add the following httpRuntime values between the </customErrors> and <webServices> sections in the web.config file. The default location for the web.config file is C:\Program Files\Microsoft Dynamics\GPWebServices\WebServices.

<httpRuntime maxRequestLength="81920" executionTimeout="300000"/>

3. Increase the TransactionTimeoutSeconds value from 60 to a larger number in the web.config file from step 2.

<add key="TransactionTimeoutSeconds" value="9999" />

4. Add the following <system.transactions> section to the machine.config file for the .Net Framework 2.0. The default location for the machine.config file is C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config. You can place the section directly under </system.data>.

</system.data>
<system.transactions>
<machineSettings maxTimeout="0:00:00"/>
</system.transactions>

5. In the application code that calls the Web Services for Dynamics GP, set the Timeout property on the DynamicsGP object:

// Create an instance of the web service
DynamicsGP wsDynamicsGP = new DynamicsGP();
wsDynamicsGP.Timeout = System.Threading.Timeout.Infinite;

 

Hopefully these settings will help in your Dynamics GP Web Service or eConnect applications where the transaction is running into a timeout error.

Chris

Posted: Friday, June 26, 2009 9:00 AM by Chris Roehrich [MSFT]
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker