Skip to content

Triggering logic, after transaction has ended. #324

@cecemel

Description

@cecemel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions