Skip to content
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

[Bug] The HasOpenTransaction property in MySqlEntityFrameworkConnectionProvider always returns false #3135

Open
romtur opened this issue Jun 5, 2024 · 1 comment
Assignees
Labels
0 - Backlog Bug v10 Allocal to a v10 release

Comments

@romtur
Copy link

romtur commented Jun 5, 2024

Describe the bug

The HasOpenTransaction property in MySqlEntityFrameworkConnectionProvider always returns false, preventing changes to the outbox and entity store from being written in the same transaction.

The solution would be to override HasTransaction property as it's done in PostgreSqlEntityFrameworkConnectionProvider

public override bool HasOpenTransaction { get => _context.Database.CurrentTransaction != null; }

To Reproduce

  1. Setup the outbox using MySqlEntityFrameworkConnectionProvider as TransactionProvider
  2. Begin a transaction in EF Core
  3. Call DepositPostAsync method, passing a provider

Actual result: Message won't be written to the outbox within the scope of the transaction

image

Further technical details

  • Brighter version: 1.0.0-preview.3
  • The OS: Windows

@iancooper
Copy link
Member

Thanks, V10 will have bugs right now, so I would remind caution on production usage as opposed to V9. But it is VERY helpful that you are finding bugs in the preview. So please keep reporting them.

@iancooper iancooper added the v10 Allocal to a v10 release label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - Backlog Bug v10 Allocal to a v10 release
Projects
None yet
Development

No branches or pull requests

2 participants