{"action":"reopened","issue":{"url":"https://api.github.com/repos/yiisoft/yii/issues/3928","labels_url":"https://api.github.com/repos/yiisoft/yii/issues/3928/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii/issues/3928/comments","events_url":"https://api.github.com/repos/yiisoft/yii/issues/3928/events","html_url":"https://github.com/yiisoft/yii/issues/3928","id":102391495,"number":3928,"title":"AfterSave() within a Transaction","user":{"login":"WJRovers","id":8059129,"avatar_url":"https://avatars.githubusercontent.com/u/8059129?v=3","gravatar_id":"","url":"https://api.github.com/users/WJRovers","html_url":"https://github.com/WJRovers","followers_url":"https://api.github.com/users/WJRovers/followers","following_url":"https://api.github.com/users/WJRovers/following{/other_user}","gists_url":"https://api.github.com/users/WJRovers/gists{/gist_id}","starred_url":"https://api.github.com/users/WJRovers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WJRovers/subscriptions","organizations_url":"https://api.github.com/users/WJRovers/orgs","repos_url":"https://api.github.com/users/WJRovers/repos","events_url":"https://api.github.com/users/WJRovers/events{/privacy}","received_events_url":"https://api.github.com/users/WJRovers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-21T14:31:21Z","updated_at":"2015-08-24T07:59:41Z","closed_at":null,"body":"For this example I'm saving 3 ActiveRecords succesfully in a transaction. The 2nd AR that get's saved has a special `onAfterSave` where it sends out a 'notify' request to a seperate application (REST). This request will try to look up the saved AR directly in the database by send PK values. When there's a matching row in the database; it will save that same row in his own database.\r\n\r\nProblem: When the ActiveRecord is saved inside a transaction it will call the event but the data is not actually stored in the database as the transaction has yet to be commited.\r\nIs there a way to call the onAfterSave after the transaction has been commited? Perhaps it is possible to make a onAfterCommitSave event?"}}