-
-
Notifications
You must be signed in to change notification settings - Fork 83
Add IsDeadlockError #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
44856b0
0371af4
f428eac
cdf9494
2175fe7
7b7ca3d
415916e
b317a06
8be1396
1d8660e
b943279
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,8 +1,10 @@ | ||||||||||||||
| using DotNet.Testcontainers.Containers; | ||||||||||||||
| using EntityFramework.Exceptions.Common; | ||||||||||||||
| using EntityFramework.Exceptions.Sqlite; | ||||||||||||||
| using Microsoft.Data.Sqlite; | ||||||||||||||
| using Microsoft.EntityFrameworkCore; | ||||||||||||||
| using SQLitePCL; | ||||||||||||||
| using System.Linq; | ||||||||||||||
| using System.Runtime.InteropServices; | ||||||||||||||
| using System.Threading.Tasks; | ||||||||||||||
| using Xunit; | ||||||||||||||
|
|
@@ -52,16 +54,32 @@ public override Task NumericOverflowViolationThrowsNumericOverflowExceptionThrou | |||||||||||||
| { | ||||||||||||||
| return Task.CompletedTask; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| [Fact] | ||||||||||||||
| public override async Task Deadlock() | ||||||||||||||
| { | ||||||||||||||
| var product = new Product { Name = "Test1" }; | ||||||||||||||
| DemoContext.Products.Add(product); | ||||||||||||||
|
|
||||||||||||||
| await DemoContext.SaveChangesAsync(); | ||||||||||||||
|
|
||||||||||||||
| await using var controlContext = new DemoContext(DemoContext.Options); | ||||||||||||||
| await using var transaction1 = await DemoContext.Database.BeginTransactionAsync(); | ||||||||||||||
|
|
||||||||||||||
|
||||||||||||||
| // Execute a write operation within transaction1 to acquire a SQLite lock | |
| await DemoContext.Products | |
| .Where(c => c.Id == product.Id) | |
| .ExecuteUpdateAsync(c => c.SetProperty(p => p.Name, "Test11")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
IsDeadlockErroras a new abstract interface member is a source/binary breaking change for any externalIDbExceptionClassifierimplementations. If this package is meant to be extensible, consider providing a default interface implementation returningfalse(net8 supports DIMs) to preserve compatibility, or ensure the package versioning reflects a breaking change.