Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / December 2004

Tip: Looking for answers? Try searching our database.

MSDTC error on vb.net HELP!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MarcoB - 11 Oct 2004 02:00 GMT
I am trying to use Microsoft Distributed Processing  and I am getting the
following error.

"There is no MTS objectcontext " I have SQL MSDTC loaded on my PC.

I have added the code below:
Any ideas ?? Tks.

------------------------------------
Imports System.EnterpriseServices

<Transaction(TransactionOption.Required)> _
Public Class Form1
   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
       ExecInTran()
   End Sub

   Public Function ExecInTran() As Boolean

       Dim queueA As New MessageQueue()

       Try
           'step1: Do step DB stuff
           'step2: DO MSMQ stuff
           ContextUtil.SetComplete()
           Return True
       Catch ex As Exception
           ContextUtil.SetAbort()
           Return False

       Finally
           queueA.Close()
       End Try

   End Function

End Class
Mike Dice [MSFT] - 11 Oct 2004 04:49 GMT
I would assume, you haven't created an object context before calling a
method on ContextUtil. You need to create a context before you access a
context.

If you aren't using components that are registered in COM+ applications but
you still want to use the services of COM+ (like transactions), then use the
COM+ 'Services Without Components' (SWC) feature. It works on Win2k3 and XP
SP2. Do this:

ServiceConfig config = new ServiceConfig(/* whatever settings you want */);
ServiceDomain.Enter(config);
// do stuff in a transaction...

ServiceDomain.Leave();

Look on MSDN for docs on:
Services Without Components (in COM+ SDK documentation)
System.EnterpriseServices.ServiceConfig (in .Net docs)
System.EnterpriseServices.ServiceDomain.(in .Net docs)

HTH
MikeDice [MSFT]

>I am trying to use Microsoft Distributed Processing  and I am getting the
>following error.
[quoted text clipped - 34 lines]
>
> End Class
Mateus Velloso - 03 Dec 2004 16:30 GMT
Mike, I am using Services Without Components and I am loving that, but I have 3 questions about it:

1-Does Microsoft supports and recommends the use of this feature?
2-Will this be compatible with Indigo (no future Migration or upgrade problems)?
3-Is there a bug when you set Isolation to ReadUnCommited to the transaction (seems to be ignored...)?

Thanks!

Mateus Padovani
MCP, MCAD, MCSA, MCSD, MCSE, MCDBA, MCT,
Oracle Certified Professional, Sun Certified J2EE

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.