Groups | Blog | Home
all groups > dotnet distributed apps > july 2005 >

dotnet distributed apps : System.Transactions -- "The transaction has already been implicitly or explicitly committed or aborted" exception when opening SqlConnetion


news.microsoft.com
7/19/2005 12:00:00 AM
Hi, everybody!

I sure hope somebody has already stumbled upon a similar problem and found a
solution.

Basically I'm having a problem with establishing a transaction between my
app server and a sql server, both on different boxes.

When I try and open the connection, an "The transaction has already been
implicitly or explicitly committed or aborted" exception is thrown.

What happens is that the code.:


using (System.Transactions.TransactionScope scope = new
System.Transactions.TransactionScope())
{
using (System.Data.SqlClient.SqlConnection conn = new
System.Data.SqlClient.SqlConnection(ConnString))
{
conn.Open(); // <-- This is where the error occurs
//Do some work
}
}

....throws the exception when I try to open the connection. The
connectionstring points to sql server 2000 on a separate windows 2003 SP1
box. The app server box the code is running on is a Windows 2003 SP1 VPC on
top of Windows XP. I am running Beta 2, both MSDTCs have been configured
with minimum security settings (allowed network transactions, no
authentication necessary, etc.), the Windows firewall of the XP box hosting
the VPC is turned off, and I am in an AD environment with a Windows 2000
Domain Controller.

The same configuration works at home, the only difference is that I use a
WinXP Sp2 box for sql server and that I have NO domain. (I had to solve the
security problems, but it works now). Also, the code executes fine when no
transaction is used, so the connection is ok as well.

I would assume that the problem is essentially DTC-related, but really have
no clue on how to approach it. It really smells of the "MSDTC fails to
mutually authenticate when computers do not run in the same domain" problem
(http://www.dotnet247.com/247reference/a.aspx?u=http://support.microsoft.com/?id=827805)
apart from the machines actually being in the same domain and that rpc
security has been turned off. Any ideas, hints, or tips would be greatly
appreciated.


Thank you & best regards,


Ziga Jakhel

ziga.jakhel(at)rrc.si



Mike
9/14/2005 8:54:30 AM
Hey Ziga,

I've got a very similar problem. I'm using SQL 2005 and my code executes the
first execute statement in my using statement, but fails with Access Denied
on the second request. All works fine when going form XP to windows 2003.
But when you go from Windows 2003 to Windows 2003 it fails.

Did you ever get this resolved? Are we the only 2 people out there using
System.Transactions????

Thanks
Mike

[quoted text, click to view]

MarkIke
11/15/2005 12:00:00 AM

If your app server is an XPsp2 box, trying opening up port 135. Msdt
and dcom use this port for network comm

--
MarkIk
-----------------------------------------------------------------------
MarkIke's Profile: http://www.hightechtalks.com/m27
View this thread: http://www.hightechtalks.com/t219114
chicki_illu
2/2/2006 12:00:00 AM

Open Component Services window from Administrative Tools
[or Click “Start”, select “Run”, type “dcomcnfg.exe”]
select component services under console root and
Right-Click “My Computer” and select Properties.


Select MSDTC tab.


Click on “Security Configuration…” button.


Enable “Network DTC Access”, “Allow Remote Clients” and “Allo
Outbound”
go to services under console root.
Restart “Distributed Transaction Coordinator” Service.

Do an iisreset. (click start - run - iisreset)

please let me know if u found any issues on this.

thanks
sudhakar
mail id : sudhakar_v02@infosys.co

--
chicki_ill
-----------------------------------------------------------------------
chicki_illu's Profile: http://www.hightechtalks.com/m88
View this thread: http://www.hightechtalks.com/t219114
AddThis Social Bookmark Button