CSLA .NET

From Rockford Lhotka's Expert C# 2005 and VB 2005 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

MSDTC on server XYZ unavailable when deleting - solved

Last post 08-07-2008, 2:41 AM by stefan. 0 replies.
Sort Posts: Previous Next
  •  08-07-2008, 2:41 AM 25282

    MSDTC on server XYZ unavailable when deleting - solved

    Hi,

    I recently encountered the well known 'MSDTC on server unavailable' message problem
    while I was trying to delete an object from within the objects edit form (-> DataPortal_DeleteSelf ).
    I was using the ConnectionManager pattern, so at first I was stumbled...

    I found out that removing the Transactional attribute from the DataPortal_DeleteSelf override
    solved the issue. Having the Transactional attribute on both DataPortal_DeleteSelf and 
    DataPortal_Delete resulted in two nested transactions, which obviously required MSDTC,
    even with just one connection opened at a time...

     ' <Transactional(TransactionalTypes.TransactionScope)> _
      Protected Overrides Sub DataPortal_DeleteSelf()

        DataPortal_Delete(New SingleCriteria(Of Project, Guid)(ReadProperty(Of Guid)(IdProperty)))

      End Sub

      <Transactional(TransactionalTypes.TransactionScope)> _
      Private Overloads Sub DataPortal_Delete(ByVal criteria As SingleCriteria(Of Project, Guid))

        Using ctx = ContextManager(Of ProjectTracker.DalLinq.PTrackerDataContext).GetManager(ProjectTracker.DalLinq.Database.PTracker)
          ' delete project data
        ...
        End Using

      End Sub

    So when you are just delegating to DataPortal_Delete, the attribute there seems sufficient, IMHO.
    Maybe Project Tracker is following a wrong pattern here?

    Stefan
View as RSS news feed in XML

Please contact Magenic for your .NET consulting and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems