We are implementing a kind of workflow based on LegacySearch events like in the eZ Recommendation Bundle:
It works well but depending on the code that you do in the listener. (let's say a query to get the new added object in the new stack) there is a crash because the new copied object is not yet in the DB. (Content Id not found error)
Indeed the the db->commit is done after the content/publish but the events are sent in the publish... which means that the object is not in the db at this time...
I looked into the copySubtree and the commit is correctly called before the publish: