Doxense / foundationdb-dotnet-client

C#/.NET Binding for FoundationDB Client API
BSD 3-Clause "New" or "Revised" License
149 stars 33 forks source link

Removal of transaction filters and re-implementation of the logging feature #106

Closed KrzysFR closed 4 years ago

KrzysFR commented 4 years ago

Up to now, logging of transaction was implemented as a transaction filter, a class that derives from FdbDatabaseFilter / FdbTransactionFilter and that wraps the inner transaction instance.

image FdbLoggedTransaction.FooAsync(...) handles logging, and calls into inner.FooAsync(...). This methods needs to call another operation Bar(...) that is also overloaded by the filter. In this case, the inner Bar will be called instead of the outer version. In this scenario, the "Bar" operation will not be logged. If the application code called Bar directly, it would have been logged.

This is a major issue with filters that cannot be fixed without reworking everything, so the intent is to scrapped the current implementation, and only keep the logging feature (heavily used) back inside the main transaction implementation.

This PR removes the filter infrastructure, and merge the logging code inside FdbTransaction, which will manage the FdbTransactionLog instance.

In the future, if we find a better way to do filters, we may move this outside the class again.