Thursday, September 23, 2010

eConnect 2010 Fills Event Log with Warning "Distributed Transaction was used"

After converting a Dynamics GP eConnect 9 integration to eConnect 2010, I was doing some testing, and everything looked fine.  Customers were being created in GP 2010, and everything was working smoothly. However, after several rounds of testing, I received an error:

The event log file is full

It took me a few seconds to understand what this meant--was this referring to the Windows Event Log?  This was a bit puzzling, since my integration isn't writing to the Event Log directly.  I opened the Event Viewer and poked around, but didn't see much.  But when I then selected the eConnect event log, I saw hundreds of Warning messages that had filled the log to it's default capacity of 512K (and overwrite events older than 7 days).


All of these eConnect warnings had no Event ID, and all had a Description that starts with this annoying message:

The description for Event ID ( 0 ) in Source ( Microsoft.Dynamics.GP.eConnect ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. 

Finally, half way down the Description, this information was provided:


The following information is part of the event: Distributed Transaction was used

This could be caused by new connection strings used within each xml document, but reusing the base transaction scope.

Configuration Setting 'ReuseBaseTransaction' is by default FALSE. Remove this configuration setting, or set it to FALSE if this was not the expected behavior.


Uhhhh, okay.  I am not doing anything special regarding "Distributed Transactions", so this didn't mean much to me, and after reviewing the eConnect 2010 Installation guide and Developer's guide, I couldn't find any reference to Distributed Transactions or the ReuseBaseTransaction parameter.

I even check the Microsoft.Dynamics.GP.eConnect.Service.exe.config, and ReuseBaseTransaction is not a default parameter, so I'm not yet sure where that might be located.

After doing more testing, it appears that for every customer record that I submit to the eConnect 2010 CreateEntity method, over 300 of these warning messages are recorded in the eConnect event log.  Pretty haywire.  To keep the Warnings from causing problems with the integration, I increased the size of the eConnect log and set it to overwrite events as needed.

At 10pm, lacking any other bright ideas, I compose the text for a support case and forward it to the GP partner that I'm working with for submission.  After a few e-mail exchanges, he asks if I've tried the integration on another server.  Brilliant, and painfully obvious idea that just didn't occur to me late at night.

So at 11pm, I install a fresh copy of GP 2010 and eConnect 2010 on another server, get my Visual Studio project setup, and then run the integration.  No Warnings.  In fact no activity at all in the eConnect Event Log.  Clean as a whistle, as my grandmother says.

So, the good news is that the error appears to only occur on one of my servers.  The not so good news is that Server A is a 32-bit Server 2003 machine with SQL 2005, and Server B is a 64-bit Server 2008 machine with SQL 2008.  Since the servers are so different, and since there are separate 32-bit and 64-bit eConnect 2010 installs, it is quite possible that the different configurations played a role in Warning vs. No Warning.  And the bad news is that I don't yet know what the Warning means or what is causing it.


I'll be converting two other integrations to eConnect 2010 and deploying them on the client's test server, so we'll see if the Event Log Warnings occur there.  I'll post an update if I learn more.


UPDATE:  Please see my follow up post on this topic.


Steve Endow is a Dynamics GP Certified Trainer and Dynamics GP Certified Professional.  He is also the owner of Precipio Services, which provides Dynamics GP integrations, customizations, and automation solutions.

http://www.precipioservices.com

6 comments:

  1. Hi Steve,
    Great Post! We are really excited that you decided to upgrade to the latest-and-greatest eConnect.

    One of the advantages of this version of eConnect is that we removed the need to COM+ and DTC (distributed transaction coordinator) in favor of using .Net’s lightweight transaction engine. (System.Transaction namespace) http://msdn.microsoft.com/en-us/magazine/cc163847.aspx

    We have found by doing this it has made for an easier deployment story (Firewall settings for DTC, Windows blocking network DTC, etc…), and we did also see a speed increase because there is no overhead of COM+ and DTC.

    The link explains when transactions are promoted to full distributed transactions.

    Excerpt: A SQL Server connection is initially enlisted in the transaction scope. The transaction remains lightweight and is not under the control of DTC. If a second connection is made to any database in the same transaction scope, the Lightweight Transaction is promoted to a distributed transaction under the domain of the DTC.

    As for the event you are receiving in your eConnect log. This is to inform the developer that their transaction has been promoted to a DTC which is most likely not intended. There is quite a bit of overhead when a transaction is promoted to a full-blown distributed transaction.

    Are you doing anything special inside your eConnect XML document? Are using the eConnectProcessInfo node to specify a different connection string than the one you are calling eConnect’s methods? (CreateEntity(string connectionString, string xml)) http://msdn.microsoft.com/en-us/library/ff623992.aspx If you are, than you have the option of using the SAME Sql-Transaction that is created from the original connection (ReuseBaseTransaction=true) which will result in a promotion to a distributed transaction. If you want a new transaction, than you can use the default or explicitly set it to false (ReuseBaseTransaction=false) which will result in an un-pooled SQL connection but there should be no promotion to a distributed transaction. You can set this in your app.config AppSettings section, similar to how the rest of the config options are set: http://msdn.microsoft.com/en-us/library/ff623610.aspx. This feature was added just recently, so it won’t show in the documentation until the next update of eConnect.

    As a tip, if you want to see the config options in eConnect, inside Visual Studio you can open the eConnect.dll file in Object Browser and look through the public Configuration Class. There is a description of this setting in there as well.

    The default for this is false. In your case, if you are not setting it to true and you are STILL getting a distributed transaction promotion, then this could be due to how your environment is setup. Is the database server on a different domain, subdomain, or across a vpn? Is it virtualized? (e.g. HyperV?) http://msdn.microsoft.com/en-us/library/ms229978(v=VS.90).aspx If you would like to call into Dynamics GP developer support, they could help troubleshoot why this specific machine is always promoting / escalating to a distributed transaction.

    The event log problem where you are receiving: “The description for Event ID (0) in Source ( Microsoft.Dynamics.GP.eConnect ) cannot be found.” Is an install problem and should be fixed in the next update to eConnect. Look out for this soon.

    Hopefully this information helps you in your endeavors and makes your experience with eConnect a better one.

    I am always surfing the internet to see people’s feedback and experience with eConnect. I would be interested in hearing more about your experiences.

    Regards,
    Louis

    ReplyDelete
  2. In previous versions of eConnect, it was necessary to have MSDTC installed and running to support the COM+ component. Now that this is no longer required, have you tried disabling the MSDTC service? Do you see any entries for eConnect under COM+? If so, did you try disabling/removing them?

    Just a few thoughts.

    MG.-

    ReplyDelete
  3. Hi Louis,

    Thanks a lot for the additional insight and information. eConnect 2010 is a very different world than prior versions!

    I have found that only 1 of 3 of my integrations causes the warnings in the event log (a customer import), whereas an invoice and cash receipt import do not have any messages, even though the eConnect portion of the code is identical.

    I have one idea that I'm going to try to see if it might be the cause. I'll keep you posted.

    Steve

    ReplyDelete
  4. Hi Mariano,

    Unfortunately, very little of the knowledge I have gathered about the plumbing of previous eConnect versions seems to be applicable to the underlying mechanics and transport of eConnect 2010. It's virtually identical in many respects (i.e. within visual studio), but when it comes to the Integration Service and WCF, it's a completely different world.

    My 3 integrations are deployed on the client's test server and work fine, so I'm going to have to figure out the Distributed Transaction issue in my free time. (Louis' comment provided me with alot of information, so I'm hoping to track it down.)

    I'm now trying to figure out how to deploy and configure client installs--definitely some learning curve ahead...

    Thanks,

    Steve

    ReplyDelete
  5. Thanks Steve -

    This was very helpful in resolving the issue I was having with eConnect 11. My error was slightly different but the root cause was the same.


    Description:
    The description for Event ID ( 0 ) in Source ( Microsoft.Dynamics.GP.eConnect ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Action:
    Service Shutdown and Closing of ServiceHost

    Current User Name:


    Input parameters:

    Exception type:
    System.ServiceModel.CommunicationObjectFaultedException

    Exception message:
    The communication object, System.ServiceModel.ServiceHost, cannot be used for communication because it is in the Faulted state.

    Stack Trace:
    at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
    at System.ServiceModel.Channels.CommunicationObject.Close()
    at Microsoft.Dynamics.GP.eConnect.WindowsService.OnStop()


    Thanks for your help.


    Gregory Bellis | Sr. Sales Engineer
    HighJump Software | TrueCommerce EDI Solutions Group
    Direct: 724.940.5520 x363 | Mobile: 724.496.3492
    greg.bellis@highjump.com

    ReplyDelete
  6. Hi Gregory, glad it was helpful. If you haven't seen it yet, I wrote a follow up post on the issue here where I offer some additional info:

    http://dynamicsgpland.blogspot.com/2010/09/partial-explanation-of-econnect-2010.html

    Thanks,

    Steve

    ReplyDelete