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 / New Users / July 2005

Tip: Looking for answers? Try searching our database.

Using COM+ through EnterpriseServices

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Juan Dent - 26 Jul 2005 17:49 GMT
Hi,

I am looking for the equivalent of TransactionContext object from COM+ from
.NET using EnterpriseServices, since COMSVCS.dll does not provide a primary
interop assembly (thus it is not strong name and cannot be used from strong
named assemblies). I need this because I want to do the following:

"I need to open a COM+ transaction inside an assembly, keep it open even as
a thread leaves the assembly and later either abort or commit the
transaction. Clearly this cannot be done by using the transaction attribute
since the vote is cast upon method return. I had hoped that using an
EnterpriseServices.Activity I could keep a transaction open, but it does not
seem that way."

Also, note that according to Peter Huang, COMSVCS.dll is not accompanied by
a PIA because Microsoft has placed all its functionality within the reach of
the EnterpriseServices namespace.

Signature

Thanks in advance,

Juan Dent, M.Sc.

Daryl - 26 Jul 2005 21:02 GMT
Hi Juan,

Check out CRMs Resource Managers as I think you can enlist in a transaction
then commit when you are ready.
Haven't tried it but came accross it looking for something else.

Hope this helps
Daryl

> Hi,
>
[quoted text clipped - 21 lines]
> of
> the EnterpriseServices namespace.
Juan Dent - 27 Jul 2005 00:53 GMT
No. I need the exact equivalent of what was the ITransactionContext in COM+
but withing the Enterprise Services.

I need to:

1) be able to create several transaction contexts on the same thread, and
begin a transaction on each of them, storing the contexts for use when:
        2) there is a need to create an object within one of these contexts
        3) there is a need to commit one of these transactional contexts
        4) there is a need to abort one of these transactional contexts

Signature

Thanks in advance,

Juan Dent, M.Sc.

> Hi Juan,
>
[quoted text clipped - 30 lines]
> > of
> > the EnterpriseServices namespace.
"Peter Huang" [MSFT] - 27 Jul 2005 08:23 GMT
Hi

I think in .NET, we use the attribute to control the transaction creation.

TransactionAttribute Members
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystementerpriseservicestransactionattributememberstopic.asp

We use the TransactionOption as below to control whether the component will
be in a transaction.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystementerpriseservicestransactionoptionclasstopic.asp

Disabled Ignores any transaction in the current context.
NotSupported Creates the component in a context with no governing
transaction.
Required Shares a transaction, if one exists, and creates a new
transaction, if necessary.
RequiresNew Creates the component with a new transaction, regardless of the
state of the current context.
Supported Shares a transaction, if one exists.

e.g. If A is RequiresNew, B is Supported/Required, and you now create B in
A, then A and B will be in the same transation.

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Juan Dent - 27 Jul 2005 19:16 GMT
I am aware of the use of attributes. However transactions are controlled
automatically for serviced components (COM+ components) and that is not what
I need.

As I stated in my last posting, I rather need a behavior much more identical
to the old ITransactionContext. Let me show a code snippet to clarify:

--------
public void BeginTrans(int DBType )
{
  ITransactionContext tranContext = new TransactionContextClass();
   // store the intiated transaction according to DBType, until commit or
rollback are
  // called
  this.contextMap[ DBType ] = tranContext;
}
public void CommitTrans(int DBType)
{
  // get appropiate transaction context on which to commit
   ITransactionContext tranContext = this.contextMap[ DBType ];
   tranContext.Commit();    
}
public object CreateInstanceEx( string progId, int DBType )
{
    ITransactionContext tranContext = this.contextMap[ DBType ];
    return tranContext.CreateInstance( progId );
}
-----------
Does this clear up the desired functionality? And, I am aware of the
available attributes but I don't think they can help here. At least not the
[Transaction] attribute.

Signature

Thanks in advance,

Juan Dent, M.Sc.

> Hi
>
[quoted text clipped - 28 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" [MSFT] - 28 Jul 2005 08:38 GMT
Hi

So far I am researching the issue, and I will update you with new
information ASAP.

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

"Peter Huang" [MSFT] - 29 Jul 2005 03:16 GMT
Hi

I think so far the Enterprise namespace have not covered all of the COM+
API.
We will improve in the next version, you may look at the
System.Transactions namespace in .NET 2.0:
http://msdn2.microsoft.com/library/a90c30fy(en-us,vs.80).aspx

I know it is beta still, but by waiting a few months and taking a
dependency on 2.0 you will avoid a lot of work.

Alternatively, you may try to look at "Services without components"
http://www.15seconds.com/issue/030930.htm

So far I would not recommend trying to interop to COMSVCS via PIA, because
it is not supported.

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


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.