when I try to Edit a table in SQL Server, the following error occurs: "Connection is busy with results for another command".
UniTable Configuration:
LockMode = lmPessimistic
RefreshOptions = [roBeforeEdit]
FetchAll = False
If I use FetchAll = True the error does not occur.
In PostgreSQL, it's not happen.
What's happening?
Lock - SQL Server
To solve the problem set the MultipleActiveResultSets specific option to True, like this:
In this case current session is not blocked when using FetchAll = False, and it is not necessary for OLE DB to create additional sessions for any query executing. You can find more detailed information about this property in the SDAC help.
Code: Select all
UniConnection.SpecificOptions.Values['MultipleActiveResultSets'] := 'True';
-
- Posts: 28
- Joined: Wed 24 Feb 2010 14:08
The problem is that under MARS, starting transactions, setting savepoints, rolling back to savepoints and committing transactions isn't allowed when there is even one request which is actively running under a transaction. SDAC tries to set a savepoint before locking and therefore an error is arised.
To solve the problem you should set LockMode to lmNone or set FetchAll to True.
To solve the problem you should set LockMode to lmNone or set FetchAll to True.