Skip to content

Issue with afterCommit Not Working as Expected on ArangoDB Connection #195

@endlesskwazar

Description

@endlesskwazar

Hi,

I’ve been trying to use DB::afterCommit() and Job::dispatch($payload)->afterCommit, but I noticed that the job is executed immediately, without waiting for the transaction to commit.

After some investigation, I found that the ArangoDB connection extends the Laravel connection class, and both use their own versions of the ManagesTransactions trait (with differing implementations). Both connection instances also have access to a singleton instance of DatabaseTransactionsManager, which is responsible for tracking transactions.

The Laravel version of ManagesTransactions correctly calls methods on the DatabaseTransactionsManager, enabling afterCommit functionality. However, the ArangoDB version does not make these calls, even though it has access to the same transaction manager instance.

My questions:

  • Has anyone looked into this behavior or done similar testing?
  • Would it be feasible to adapt the relevant parts of Laravel’s ManagesTransactions trait to the ArangoDB version to support afterCommit hooks?
  • Alternatively, is there something fundamental in how ArangoDB handles transactions that would require a different or more extensive approach?

Thanks in advance, and wishing you a great day. 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions