ADO.NET or Enterprise Services (ES)

  • Thread starter Thread starter lottoman2000
  • Start date Start date
L

lottoman2000

I am debating which route to take for Declarative Trans
Application. ADO.NET or ES (COM+). What do i gain by going
the ADO.NET rounte and cetainly at what cost?
Thank you
 
ADO.NET gets my vote.

Here are the reasons -

ES - means GAC - means strongly named - pain in the butt.
ADO.NET gives you the option of creating distri trans at database level.
Managing those transactions without involving MSDTC is a better idea, if
both RMs are going to be databases.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/
 
1) ADO.NET Transactions: Good for local transactions to a single database

2) EntServices (COM+) Transactions: Good for distributed transactions, but
costly for local transactions. Plus the GAC, plus strong names, plus COM+
overhead.

--John Papa
http://codebetter.com/blogs/john.papa
 
Two things I can think right off the bat -

a) Deployment is a pain.
b) Deploying newer versions is stricter (without a public key, you can
simply swap the dll, as long as signatures don't change, but with a strong
key oooh good luck !!)
c) Newer versions are simply overwrite the file, with GAC u gotta do a
publisher policy, or two versions end up in the GAC.

Wait that's 3 downsides LOL :)

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/





Miha Markic said:
What's wrong with strong names and GAC (apart from registration)?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

John Papa said:
1) ADO.NET Transactions: Good for local transactions to a single database

2) EntServices (COM+) Transactions: Good for distributed transactions, but
costly for local transactions. Plus the GAC, plus strong names, plus COM+
overhead.

--John Papa
http://codebetter.com/blogs/john.papa
 
I wanna add.

Even if you wanna do distributed transactions with ADO.NET in 1.1, you can
still do them at the database level using linked servers, or BEGIN
DISTRIBUTED TRANSACTION.

It's just not as elegant as 2.0, but it's sure better than involving MSDTC.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/
 
My vote goes to using System.Transactions in the 2.0 framework as the best
choice.
http://blogs.msdn.com/angelsb/archive/category/6274.aspx

If you want to use v1.1 then I would vote for ServiceConfig.
http://blogs.msdn.com/florinlazar/archive/2004/07/24/194199.aspx

The only downside of ServiceConfig is that it requires Windows2003 or WinXp
service pack 2, other than that it is a very clean way of dealing with
distributed transactions, no strong name signing or using attributes. Here
is some code:

ServiceConfig config = new ServiceConfig();
config.Transaction = TransactionOption.Required;

ServiceDomain.Enter(config);

try

{

MyTxCode(); //SqlConnections will autoenlist on tx here

}

catch(Exception e)

{

// we got an exception

Console.WriteLine(e.Message);

// so, we should abort the transaction

ContextUtil.SetAbort();

}

finally

{

ServiceDomain.Leave();

}


--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/




Sahil Malik said:
Two things I can think right off the bat -

a) Deployment is a pain.
b) Deploying newer versions is stricter (without a public key, you can
simply swap the dll, as long as signatures don't change, but with a strong
key oooh good luck !!)
c) Newer versions are simply overwrite the file, with GAC u gotta do a
publisher policy, or two versions end up in the GAC.

Wait that's 3 downsides LOL :)

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/





Miha Markic said:
What's wrong with strong names and GAC (apart from registration)?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

John Papa said:
1) ADO.NET Transactions: Good for local transactions to a single database

2) EntServices (COM+) Transactions: Good for distributed transactions, but
costly for local transactions. Plus the GAC, plus strong names, plus COM+
overhead.

--John Papa
http://codebetter.com/blogs/john.papa


:

I am debating which route to take for Declarative Trans
Application. ADO.NET or ES (COM+). What do i gain by going
the ADO.NET rounte and cetainly at what cost?
Thank you
 
Angel,

Even when a distributed transaction can be contained using transactions at
the database level ... do you still recommend using Syst.Tran?
Why so? I thought MSDTC was evil. (We're talking 2 databases, not one).

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/



Angel Saenz-Badillos said:
My vote goes to using System.Transactions in the 2.0 framework as the best
choice.
http://blogs.msdn.com/angelsb/archive/category/6274.aspx

If you want to use v1.1 then I would vote for ServiceConfig.
http://blogs.msdn.com/florinlazar/archive/2004/07/24/194199.aspx

The only downside of ServiceConfig is that it requires Windows2003 or WinXp
service pack 2, other than that it is a very clean way of dealing with
distributed transactions, no strong name signing or using attributes. Here
is some code:

ServiceConfig config = new ServiceConfig();
config.Transaction = TransactionOption.Required;

ServiceDomain.Enter(config);

try

{

MyTxCode(); //SqlConnections will autoenlist on tx here

}

catch(Exception e)

{

// we got an exception

Console.WriteLine(e.Message);

// so, we should abort the transaction

ContextUtil.SetAbort();

}

finally

{

ServiceDomain.Leave();

}


--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/




Sahil Malik said:
Two things I can think right off the bat -

a) Deployment is a pain.
b) Deploying newer versions is stricter (without a public key, you can
simply swap the dll, as long as signatures don't change, but with a strong
key oooh good luck !!)
c) Newer versions are simply overwrite the file, with GAC u gotta do a
publisher policy, or two versions end up in the GAC.

Wait that's 3 downsides LOL :)

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/





Miha Markic said:
What's wrong with strong names and GAC (apart from registration)?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

1) ADO.NET Transactions: Good for local transactions to a single database

2) EntServices (COM+) Transactions: Good for distributed
transactions,
but
costly for local transactions. Plus the GAC, plus strong names, plus COM+
overhead.

--John Papa
http://codebetter.com/blogs/john.papa


:

I am debating which route to take for Declarative Trans
Application. ADO.NET or ES (COM+). What do i gain by going
the ADO.NET rounte and cetainly at what cost?
Thank you
 
Must have slept through the thread, I thought that he was asking about
scenarios where a single transaction will not work so no way to use
transactions at database level. If the question is whether to use dtc or
local transactions then definitelly use local transactions and preferably in
the stored proc level.

If on the other hand you need to use two connections I would use
System.Transactions rather than sp_bindsession. Against two different
servers again dtc is hard to beat.

--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/




Sahil Malik said:
Angel,

Even when a distributed transaction can be contained using transactions at
the database level ... do you still recommend using Syst.Tran?
Why so? I thought MSDTC was evil. (We're talking 2 databases, not one).

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/



Angel Saenz-Badillos said:
My vote goes to using System.Transactions in the 2.0 framework as the best
choice.
http://blogs.msdn.com/angelsb/archive/category/6274.aspx

If you want to use v1.1 then I would vote for ServiceConfig.
http://blogs.msdn.com/florinlazar/archive/2004/07/24/194199.aspx

The only downside of ServiceConfig is that it requires Windows2003 or WinXp
service pack 2, other than that it is a very clean way of dealing with
distributed transactions, no strong name signing or using attributes. Here
is some code:

ServiceConfig config = new ServiceConfig();
config.Transaction = TransactionOption.Required;

ServiceDomain.Enter(config);

try

{

MyTxCode(); //SqlConnections will autoenlist on tx here

}

catch(Exception e)

{

// we got an exception

Console.WriteLine(e.Message);

// so, we should abort the transaction

ContextUtil.SetAbort();

}

finally

{

ServiceDomain.Leave();

}


--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/




Sahil Malik said:
Two things I can think right off the bat -

a) Deployment is a pain.
b) Deploying newer versions is stricter (without a public key, you can
simply swap the dll, as long as signatures don't change, but with a strong
key oooh good luck !!)
c) Newer versions are simply overwrite the file, with GAC u gotta do a
publisher policy, or two versions end up in the GAC.

Wait that's 3 downsides LOL :)

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/





"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
What's wrong with strong names and GAC (apart from registration)?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

1) ADO.NET Transactions: Good for local transactions to a single
database

2) EntServices (COM+) Transactions: Good for distributed transactions,
but
costly for local transactions. Plus the GAC, plus strong names, plus
COM+
overhead.

--John Papa
http://codebetter.com/blogs/john.papa


:

I am debating which route to take for Declarative Trans
Application. ADO.NET or ES (COM+). What do i gain by going
the ADO.NET rounte and cetainly at what cost?
Thank you
 
Right, exactly my thoughts (afterall I learnt all this from you .. LOL).

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/





Angel Saenz-Badillos said:
Must have slept through the thread, I thought that he was asking about
scenarios where a single transaction will not work so no way to use
transactions at database level. If the question is whether to use dtc or
local transactions then definitelly use local transactions and preferably
in
the stored proc level.

If on the other hand you need to use two connections I would use
System.Transactions rather than sp_bindsession. Against two different
servers again dtc is hard to beat.

--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/




Sahil Malik said:
Angel,

Even when a distributed transaction can be contained using transactions
at
the database level ... do you still recommend using Syst.Tran?
Why so? I thought MSDTC was evil. (We're talking 2 databases, not one).

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/



message
My vote goes to using System.Transactions in the 2.0 framework as the best
choice.
http://blogs.msdn.com/angelsb/archive/category/6274.aspx

If you want to use v1.1 then I would vote for ServiceConfig.
http://blogs.msdn.com/florinlazar/archive/2004/07/24/194199.aspx

The only downside of ServiceConfig is that it requires Windows2003 or WinXp
service pack 2, other than that it is a very clean way of dealing with
distributed transactions, no strong name signing or using attributes. Here
is some code:

ServiceConfig config = new ServiceConfig();
config.Transaction = TransactionOption.Required;

ServiceDomain.Enter(config);

try

{

MyTxCode(); //SqlConnections will autoenlist on tx here

}

catch(Exception e)

{

// we got an exception

Console.WriteLine(e.Message);

// so, we should abort the transaction

ContextUtil.SetAbort();

}

finally

{

ServiceDomain.Leave();

}


--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/




Two things I can think right off the bat -

a) Deployment is a pain.
b) Deploying newer versions is stricter (without a public key, you
can
simply swap the dll, as long as signatures don't change, but with a strong
key oooh good luck !!)
c) Newer versions are simply overwrite the file, with GAC u gotta do
a
publisher policy, or two versions end up in the GAC.

Wait that's 3 downsides LOL :)

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/





"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
What's wrong with strong names and GAC (apart from registration)?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

1) ADO.NET Transactions: Good for local transactions to a single
database

2) EntServices (COM+) Transactions: Good for distributed transactions,
but
costly for local transactions. Plus the GAC, plus strong names, plus
COM+
overhead.

--John Papa
http://codebetter.com/blogs/john.papa


:

I am debating which route to take for Declarative Trans
Application. ADO.NET or ES (COM+). What do i gain by going
the ADO.NET rounte and cetainly at what cost?
Thank you
 
Back
Top