MsSQL New transaction is not allowed because there are other threads running in the session
Dears, we are trying to move large project from Delphi 11.2 ADO to Delphi 11.3 UniDAC. We use Firebird and MsSQL. We use main DbConnection and separate DbConnections for specific actions. We open forms with main DbConnection and we often use
SpecificOptions.Values[FETCH_ALL] := False
FetchRows := xx
for DbGrids with large datasets.
We also use short transactions under main DbConnection (for opening series of datasets or specific DML actions requiring transactions) and we are getting:
New transaction is not allowed because there are other threads running in the session on MsSQL.
I have searched the topic and found that there is a conflict in FetchAll False and transactions under one DbConnection. I have tried to set NonBlocking on queries to True, but didn't help - exception raises less frequently but raises. We use SpecificOptions.Values['MultipleActiveResultSets'] := 'True' for MsSQL. Problem occurs also on small test app with large MsSQL DB which I cannot send.
Is there other any solution then rewriting FetchAll False queries to separate connections?
Under ADO and MSOLEDBSQL provider everything works fine - no problem to set MaxRecords and use transactions without limit. Thanks for any idea :).