You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nested service usage with transaction hooks at both of them? #118
I think from a glance at the source code, that nested service calls where both the calling and the called service use the same transaction don't work?
At the moment it would cause nested transactions to run. E.g. MariaDB would COMMIT and start a new transaction. SQL Server would start a nested transaction.
Activity
RobIsHere commentedon Sep 16, 2017
A reference counting mechanism could solve this in a way that only the outer transition is ever considered. This behavior could be added to the docs.
At start:
if no params.transaction:
start it
set params.transaction. refCounter = 0
else
params.transaction. refCounter++
At end:
if (params.transaction. refCounter == 0)
commit
else
params.transaction. refCounter--
At rollback:
Nothing to change because the error hook cancels further hook and service processing
I can make a PR if you are open for this solution?
RobIsHere commentedon Sep 25, 2017
transaction.end() in nested service call throws an error at the outer transaction.end()
Cannot read property 'rollback' of null