Skip to content

Commit 3131a03

Browse files
added important comment
1 parent cdac0b1 commit 3131a03

File tree

1 file changed

+8
-0
lines changed
  • examples/src/EntityFrameworkCore.Ydb.QuickStart

1 file changed

+8
-0
lines changed

examples/src/EntityFrameworkCore.Ydb.QuickStart/Program.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ public BloggingContext CreateDbContext(string[] args)
3333
{
3434
var optionsBuilder = new DbContextOptionsBuilder<BloggingContext>();
3535

36+
// IMPORTANT!
37+
// Disables retries for the migrations context.
38+
// Required because migration operations may use suppressed or explicit transactions,
39+
// and enabling retries in this case leads to runtime errors with this provider.
40+
//
41+
// "User transaction is not supported with a TransactionSuppressed migrations or a retrying execution strategy."
42+
//
43+
// Bottom line: ALWAYS disable retries for design-time/migration contexts to avoid migration failures and errors.
3644
return new BloggingContext(
3745
optionsBuilder.UseYdb("Host=localhost;Port=2136;Database=/local",
3846
builder => builder.DisableRetryOnFailure()

0 commit comments

Comments
 (0)