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

Review on transactions are handled, on before and on after CRUD operations #282

Open
walteralmeida opened this issue Feb 13, 2024 · 0 comments

Comments

@walteralmeida
Copy link
Collaborator

See ticket #254

By default on before and on after events are not called within the CRUD transaction, unless added (and removed) Explicitly.
This is to keep the duration of the transaction as short as possible, especially if time consuming operations are done.

The way we add a on before or on after event in transaction is by always having an on before / on after pair, creating the transaction on before and leaving it on after. In GO it is done with the EnsureDataAccessAdaptor and DisposeAccessAdaptor methods.

But that's cumbersome. To make sure we dispose the transaction, we have to call the on after method in a catch block, in case there is an exception sent before reaching the regular on after. Better to find a better way that's no so much error prone.

Maybe a way to define as part of the extension definition if it should be part or not of the transaction. Or add 2 events to have separates extension point wether we want or not to be part of the transaction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant