Questions tagged [sql-server-mars]

Multiple Active Result Sets is a feature used on Microsoft's SQL Server to allow multiple batch execution on a single server

Multiple Active Results Sets is a technique used within Microsoft's SQL Server database management system to enable a single database connections to be used for multiple purposes.

Links

79 questions
87
votes
3 answers

Disadvantages of MARS (Multiple Active Result Sets)?

Does anyone know of any disadvantages of MARS (Multiple Active Result Sets)? Does anyone know of any reason why one should avoid using MARS, like cases where cursors are more useful then MARS.
Samiksha
  • 5,852
  • 6
  • 26
  • 28
9
votes
1 answer

What effect does MARS have on NHibernate?

I'm comparing Entity Framework with NHibernate, and I'd like to know if when using SQL Server, what effect (if any) would enabling or disabling MARS support have on NHibernate? MARS = Multiple Active Result Sets The Entity Framwork documentation…
Matt Johnson-Pint
  • 197,368
  • 66
  • 382
  • 508
7
votes
1 answer

Is ODBC from MARS but ADO/OLEDB from VENUS?

Short question: I am finding I need to use MARS over ODBC but not over ADO/OLEDB, is that correct? Longer explanation: I just discovered my ODBC code (using "Driver={SQL Native Client}", MFC CDatabase code) needs to have MARS…
JB1
  • 131
  • 1
  • 5
7
votes
1 answer

ServiceStack MARS (Multiple Active Result Sets) using ORMLite and Output Parameters

ServiceStack ORMLite is great, I've typically steered clear of the ORM mentality preferring to build databases as it makes sense to build databases instead of a 1:1 class model. That said, there are a couple of things that I seem to be running into…
6
votes
1 answer

When should I use MultipleActiveResultSets=True when working with ASP.NET Core 3.0 and SQL Server 2019+?

Most applications I have programmed do not use MultipleActiveResultSets=True, but I have seen the option being enabled in a couple of them and in a few tutorials. This SO question deals with the same topic, but it is very old and I believe that…
5
votes
3 answers

SQL Exception: "Impersonate Session Security Context" cannot be called in this batch because a simultaneous batch has called it

When opening a connection to SQL Server 2005 from our web app, we occasionally see this error: "Impersonate Session Security Context" cannot be called in this batch because a simultaneous batch has called it. We use MARS and connection pooling. The…
3
votes
0 answers

Azure Function App with .NET Framework + MARS (Multiple Active Record Sets)

We have a v1 Azure Function App. It has to be v1 because our client insists on .NET Framework as their organisation has familiarity with Framework and has not migrated to .NET Core. Our architect has stipulated that MARS (Multiple Active Record…
3
votes
1 answer

difference between NextResult and MARS

What's the difference between using .NextResult and Multiple Active Result Sets? sqlReader.NextResult(); while (sqlReader.Read()) { MessageBox.Show("From third SQL - " + sqlReader.GetValue(0) + " - " + …
Rod
  • 12,599
  • 23
  • 97
  • 188
3
votes
1 answer

is it Efficient to use Mars to Update 7000 Rows?

I have a service to update/inserts 7000+ rows using MARS. Is there a better way to do this?
Luke101
  • 56,845
  • 75
  • 204
  • 330
3
votes
1 answer

How to use ormlite with SQL Server and Mars?

ServiceStack aficionados, hello! We are legion (I hope so), so please help a brother out :) I am trying to populate two collections with one SQL Server 2008 stored procedure call that return two resultsets. I have "MultipleActiveResultSets=True" in…
3
votes
1 answer

multiple active result set(MARS) on Appharbor how to enable?

this is my first question at stackoverflow, so bear with me. In my local project I use ASP.NET MVC 3 and Entity Framework 4.3 with SQL Express. in my connection string i have MARS set to true; but when i am deploying my project on to Appharbor,…
2
votes
1 answer

How to use Plotmo for plotting an arima object

I would like to use plotmo instruction from Plotmo package to plot an arima object I estimate arima model with a matrix of explanatory variables X ( transfer function) arima.model<-arima(y,c(3,1,3),xreg=X) When plotting this object I have the next…
2
votes
0 answers

Net_Transport TPC and Session with MARS Enabled

I'm working on a site with several apps and services with EF and the database is throwing the following error: The server will drop the connection, because the client driver has sent multiple requests while the session is in single-user mode.…
2
votes
1 answer

Getting singleton-per-query values back with Postgres

Since Postgres doesn't appear to have the functionality of multiple resultsets per UDF(SQL Server does). What is the best way to return query-wide-singleton values? For example when paginating the results of a FTS search, it simplifies logic if we…
Hassan Syed
  • 19,054
  • 9
  • 76
  • 156
1
vote
1 answer

Does Entity Framework 6 async parallel queries use Multiple Active Result Sets for connection pooling

I have some very large queries the EF is creating resulting in slow response times and high CPU use so I thought as a way to optimize I'd try to implement MARS and Async parallel queries to pull back multiple, simpler result sets in parallel and…
1
2 3 4 5 6