Hi Bobben,
If I'm reading this correct, you have something like this:
[Transaction(TransactionOption.Required)]
public class A : ServicedComponent
{
[AutoComplete]
void Execute() {
SubExecute();
}
protected virtual SubExecute() { }
}
[Transaction(TransactionOption.Required)]
public class B : A {
[AutoComplete]
void SubExecute() {
// do work
}
}
In this case, if you create an instance of class B and call Execute, I think
that will happen is this:
1. Base class A's Execute will be called. Since TransactionOption.Required
is specified, a transaction will be created.
2. B.SubExecute will be called. Since there is already a transaction, it
will be used for the execution of SubExecute
3. Upon returning from B.SubExecute, AutoComplete will commit the
transaction.
4. Returning from A.Execute will also try to commit the transaction,
yielding the error you are seeing.
Also, if you remove the inheritance from ServicedComponent, I don't think a
transaction will actually get created in the background through COM+.
HTH,
Mark Jen [MSFT]

Signature
Please reply in newsgroup.
This posting is provided "AS IS" with no warranties, and confers no rights.
> I have to add that several of my database functions (both the C# code and
> the stored procedures) calls Begin Transaction. Is this a problem?
[quoted text clipped - 37 lines]
> >
> > B?rge
Mark Jen [MSFT] - 24 Feb 2004 00:07 GMT
Also, calling BeginTransaction and/or using a "begin transaction" in TSQL
shouldn't cause a problem. AFAIK, those calls make a SQL local database
transaction which should then be automatically enlisted in the distributed
transaction if one exists. Thus, the outcome of the local transaction should
be dependent on the distributed transaction.
Thanks,
Mark Jen [MSFT]

Signature
Please reply in newsgroup.
This posting is provided "AS IS" with no warranties, and confers no rights.
> Hi Bobben,
>
[quoted text clipped - 79 lines]
> > >
> > > B?rge
bobben - 05 Mar 2004 11:03 GMT
Thanks for your input.
I aggree with you in the way you described it.
But in B::SubExecute() i call another assembly (which is not registered with
Com+) which in turn does the actual db work.
Could this be the problem?
B?rge
> Also, calling BeginTransaction and/or using a "begin transaction" in TSQL
> shouldn't cause a problem. AFAIK, those calls make a SQL local database
[quoted text clipped - 96 lines]
> > > >
> > > > B?rge