Brighter icon indicating copy to clipboard operation
Brighter copied to clipboard

[Bug] The HasOpenTransaction property in MySqlEntityFrameworkConnectionProvider always returns false

Open romtur opened this issue 1 year ago • 1 comments

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

romtur avatar Jun 05 '24 14:06 romtur

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 avatar Jun 12 '24 10:06 iancooper