Does MARS use multiple connections behind the scenes?

  • Thread starter Thread starter Simon Harvey
  • Start date Start date
S

Simon Harvey

Hi all,

Quick question. I would like to use MARS to avoid lots of additional
connections being opened in a certain area of code that I have (a deep
load style scenario)

As I understand it, it allows you to have several open data readers on
the one connection. Seems pretty straight forward really.

The thing that puzzles me is that in most of the documents I've read
about it, it states that there is no performance advantage to using it.
I don't mind that, but its does puzzle me a bit.

How can there be no performance advantage to NOT opening and disposing
potentially scores of additional connections? I know we have to factor
in connection pooling, but even still, there must be some overhead to
the alternative of creating and breaking all those extra SQLConnection
objects.

Then I got to thinking, what if its just a sort of abstraction layer -
where it is actually opening more connections behing the scenes so the
programmer doesnt need to worry about it.

I'm next to certain that that wont be the case, but could someone
explain to me why MARS isn't much more resource efficient?

Many thanks to anyone who can advise

Kindest Regards

Simon
 
Simon Harvey said:
Hi all,

Quick question. I would like to use MARS to avoid lots of additional connections being
opened in a certain area of code that I have (a deep load style scenario)

As I understand it, it allows you to have several open data readers on the one connection.
Seems pretty straight forward really.

The thing that puzzles me is that in most of the documents I've read about it, it states
that there is no performance advantage to using it. I don't mind that, but its does puzzle
me a bit.

How can there be no performance advantage to NOT opening and disposing potentially scores
of additional connections? I know we have to factor in connection pooling, but even still,
there must be some overhead to the alternative of creating and breaking all those extra
SQLConnection objects.

Then I got to thinking, what if its just a sort of abstraction layer - where it is
actually opening more connections behing the scenes so the programmer doesnt need to worry
about it.

I'm next to certain that that wont be the case, but could someone explain to me why MARS
isn't much more resource efficient?

Many thanks to anyone who can advise

Kindest Regards

Simon

Did you read this:
http://msdn2.microsoft.com/en-us/library/ms345109.aspx
and
http://blogs.msdn.com/sqlnativeclient/archive/2006/09/27/774290.aspx


Willy.
 
Back
Top