-
-
Notifications
You must be signed in to change notification settings - Fork 9
Description
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. 🙏