Enlist attribute in connection string in absence of MTS

  • Thread starter Thread starter Bhupesh
  • Start date Start date
B

Bhupesh

Hi,

Is there any effect of Enlist attribute in the connection string if
there is not DTS environment, No COm+ or MTS.

I am facing a problem where the connections I receive from a connection
pool has pending transaction. is this anyway possible?

Regards,
Bhupesh
 
The enlist attribute is useful when you wish to spawn a connection within a
transactionscope which you donot want to auto enlist within the current
running transaction - a good place to use it would be in SQLCLR.

Regards your getting a connection from the connection pool which has a
pending transaction - there is something hokey with your architecture over
there. If you are not using Sys.Tx or MSDTC, then you are probably marking a
connection close after calling BEGIN Transaction on it. Otherwise you are
locking resources and closing a SqlConnection inside a transactionscope
without explicitly issuing a rollback or commit. Lastly, somewhere in your
architecture you could be forgetting to call ROLLBACK explicitly. Please see
my book chapter 11 for various explanations and reasons, but long story
short, there's something funky in the rest of your app - with no easy way of
finding out where. The only way in fact is print diagnostic information
such as spid for each connection when open and trace that to pending
transactions - see who used it before you - and that is the culprit. This of
course can be done only if you have a neat & clean data layer.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
__________________________________________________________
 
Back
Top