You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version:
Problem was discovered due to version update from 6.5.6 to 8.0.2
Problem:
If we have many Merge/Read operations with the same entity type inside one transaction, then an exception will occur. Microsoft.Data.SqlClient.SqlException (0x80131904): There is already an object named '#SomeEntityTemp' in the database
Config:
Reason:
Some optimizations were done in code not to do extra db query execution call in case of usage of temp db.
It didn't work properly in case of multiple requests for entities of same type with config above because temp table name generation depends on entity type.
The possible solution is to use UniqueTableNameTempDb=true, but it is not optimal due to SQL Server query plan caching.
The text was updated successfully, but these errors were encountered:
dimonchelli-dev
changed the title
Many Merge/Read SQL operations inside one transaction raise exception that temp temple already exists
Many Merge/Read SQL operations inside one transaction raise exception that temp table already exists
Mar 4, 2024
Version:
Problem was discovered due to version update from 6.5.6 to 8.0.2
Problem:
If we have many
Merge
/Read
operations with the same entity type inside one transaction, then an exception will occur.Microsoft.Data.SqlClient.SqlException (0x80131904): There is already an object named '#SomeEntityTemp' in the database
Config:
Reason:
Some optimizations were done in code not to do extra db query execution call in case of usage of temp db.
It didn't work properly in case of multiple requests for entities of same type with config above because temp table name generation depends on entity type.
The possible solution is to use
UniqueTableNameTempDb=true
, but it is not optimal due to SQL Server query plan caching.EFCore.BulkExtensions/EFCore.BulkExtensions/SqlAdapters/SqlServer/SqlServerAdapter.cs
Line 245 in 7feed45
EFCore.BulkExtensions/EFCore.BulkExtensions/SqlAdapters/SqlServer/SqlServerAdapter.cs
Line 358 in 7feed45
and maybe in other adapters
The text was updated successfully, but these errors were encountered: