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

Triggering logic, after transaction has ended. #324

Open
cecemel opened this issue Dec 2, 2021 · 1 comment
Open

Triggering logic, after transaction has ended. #324

cecemel opened this issue Dec 2, 2021 · 1 comment

Comments

@cecemel
Copy link
Contributor

cecemel commented Dec 2, 2021

Hi,

I have the following use case:
After creating, updating or deleting a record, my code needs to use this update to calculate and update another part of the model.
The database needs to be entirely up to date to calculate these correctly.

From the docs, it seems that either writing a custom adaptor or using an output hook is the way to go.
However, both are called during a transaction. At that stage, however, the database is not up to date. Hence calculations break.
I could use the client available to do an intermediate commit -which I do currently-, but this feels like a hack undermining the framework. Also, the database is not super happy when processing "COMMIT" statement not linked to a transaction. (Which seems to always happen in fortune when finishing the database operation)

So, is there a way to tackle this? If it needs an API extension, we have time for that.

Thanks for the advice

@cecemel
Copy link
Contributor Author

cecemel commented Dec 15, 2021

Any updates on this?

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