Impersonate session security context error without applying impersonation
Hi,
So I have an app that creates a SQL connection with MARS enabled and also impersonation, but it doesn't do calls in more than one thread (legacy system), and that app calls a service that also creates a SQL connection with MARS enabled, but without applying impersonation, and that service can run concurrent batches (multiple queries at the same time).
The thing is, that the service is getting the error: "Impersonate Session Security Context" cannot be called in this batch because a simultaneous batch has called it.
Could that be a bug with SQL server trying to join connections or something? The connections in that service are new, so it doesn't make sense to me that an impersonation error appears.
SQL server 2017 - .net framework 4