When a DbUpdateException
is thrown because of unique index constraint, the DbUpdateException.Entries
collection is empty. Is this an expected behavior or should it contain the involved entity in there?
EF Core version: 1.1.1
Hi,
I have the same issue on unique indexes or on primary key duplicates. The Entries value of the DbUpdateException is empty.
Regards
Versions:
EF Core version: 1.1.0
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10
IDE: Visual Studio 2017
Can I request this issue be considered again. Here is the use case.
I am trying to write a SQL error handler that will produce a user-friendly error message from a unique index constraint. I can decode the SQL Server error message if its a single column constraint, but for multiple column indexes it is far harder as I cannot use the comma separators if some of the columns are varchar.
I would also like to alert users to possible duplicate errors where the errors come from a Soft Deleted entry, hidden by a Query Filter. That requires me to extract the property values and search for the duplicate item to detect if it was hidden by a Query Filter.
@JonPSmith The issue is not closed; it is scheduled to be fixed in the 3.0 release.
Did this make its way into EF Core 2.2? I don't see and code so I assume not. Be nice to have in 3.0
@JonPSmith The milestone is set to 3.0. This means it's not in 2.2.
Any news about this? The weekly status update does not mention the item and there is only one issue that's still being worked on for 3.0.
@SebastiaanPolfliet Unfortunately, it had to be cut from 3.0. However, it is scheduled for the 3.1 release scheduled for the beginning of December.
I do also need it but it seems it has not been fixed in 3.1...
Re-triage based on https://github.com/dotnet/efcore/issues/15404#issuecomment-578224138
Any update on this? It stops us from recovering from unique collisions.
@roja This issue is in the Backlog milestone. This means that it is not planned for the next release (EF Core 5.0). We will re-assess the backlog following the this release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.
@ajcvickers Is any workaround for this issue with a performance problem?
Most helpful comment
@SebastiaanPolfliet Unfortunately, it had to be cut from 3.0. However, it is scheduled for the 3.1 release scheduled for the beginning of December.