MSSQLSERVER_3988

Applies to: SQL Server

Details

Attribute Value
Product Name SQL Server
Event ID 3988
Event Source MSSQLSERVER
Component SQLEngine
Symbolic Name XACT_UNSUPPORT_PARALLEL_TRAN2
Message Text New transaction is not allowed because there are other threads running in the session.

Explanation

This error occurs when you execute a distributed query that joins multiple tables hosted by remote instances of SQL Server while the XACT_ABORT session setting is ON. An error message similar to the following is reported to the user:

Msg 3988, Level 16, State 1, Line #
New transaction is not allowed because there are other threads running in the session.

Cause

There are some design limitations in the way SQL Server handles distributed queries (DQs) when the following conditions are true:

  • SQL Server joins multiple tables of one remote SQL Server data source.
  • The session that is issuing the query is not enlisted in a distributed transaction.

In this situation, an attempt to run the query may raise either of the two errors that are mentioned in the Explanation section.

User action

To work around the issue, enclose the distributed query in a 'begin distributed transaction' statement:

BEGIN DISTRIBUTED TRANSACTION
/*The actual Distributed Query goes next, outside of comments*/
COMMIT TRANSACTION