{"action":"created","issue":{"url":"https://api.github.com/repos/SimpleBus/SymfonyBridge/issues/18","labels_url":"https://api.github.com/repos/SimpleBus/SymfonyBridge/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/SimpleBus/SymfonyBridge/issues/18/comments","events_url":"https://api.github.com/repos/SimpleBus/SymfonyBridge/issues/18/events","html_url":"https://github.com/SimpleBus/SymfonyBridge/issues/18","id":82370457,"number":18,"title":"Logging middleware before Transactional","user":{"login":"acasademont","id":825021,"avatar_url":"https://avatars.githubusercontent.com/u/825021?v=3","gravatar_id":"","url":"https://api.github.com/users/acasademont","html_url":"https://github.com/acasademont","followers_url":"https://api.github.com/users/acasademont/followers","following_url":"https://api.github.com/users/acasademont/following{/other_user}","gists_url":"https://api.github.com/users/acasademont/gists{/gist_id}","starred_url":"https://api.github.com/users/acasademont/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acasademont/subscriptions","organizations_url":"https://api.github.com/users/acasademont/orgs","repos_url":"https://api.github.com/users/acasademont/repos","events_url":"https://api.github.com/users/acasademont/events{/privacy}","received_events_url":"https://api.github.com/users/acasademont/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-29T10:28:56Z","updated_at":"2015-06-03T07:55:30Z","closed_at":null,"body":"Hi Matthias!\r\n\r\nI've been playing this week with the shiny new version and everything works like a charm, thanks! However, I was wondering why the Transactional Doctrine middleware is registered before the Logging middleware, I would prefer the transaction to be \"as close as possible\" to the real work done inside the command. If somehow the logging failed that would mean rolling back the transaction too, which is not desirable IMHO\r\n\r\n> [2015-05-29 12:11:21] doctrine.DEBUG: \"START TRANSACTION\" [] []\r\n> [2015-05-29 12:11:21] command_bus.DEBUG: Started handling a message {\"message\":\"[object] (Ulabox\\\\Inventory\\\\Application\\\\Command\\\\Sku\\\\LinkWithProduct: {})\"} []\r\n\r\n```\r\narray(5) {\r\n  [0] =>\r\n  string(71) \"simple_bus.command_bus.finishes_command_before_handling_next_middleware\"\r\n  [1] =>\r\n  string(56) \"simple_bus.event_bus.handles_recorded_mesages_middleware\"\r\n  [2] =>\r\n  string(64) \"simple_bus.doctrine_orm_bridge.wraps_next_command_in_transaction\"\r\n  [3] =>\r\n  string(41) \"simple_bus.command_bus.logging_middleware\"\r\n  [4] =>\r\n  string(62) \"simple_bus.command_bus.delegates_to_message_handler_middleware\"\r\n}\r\n```\r\n\r\nThanks!!\r\n"},"comment":{"url":"https://api.github.com/repos/SimpleBus/SymfonyBridge/issues/comments/108235652","html_url":"https://github.com/SimpleBus/SymfonyBridge/issues/18#issuecomment-108235652","issue_url":"https://api.github.com/repos/SimpleBus/SymfonyBridge/issues/18","id":108235652,"user":{"login":"matthiasnoback","id":1193078,"avatar_url":"https://avatars.githubusercontent.com/u/1193078?v=3","gravatar_id":"","url":"https://api.github.com/users/matthiasnoback","html_url":"https://github.com/matthiasnoback","followers_url":"https://api.github.com/users/matthiasnoback/followers","following_url":"https://api.github.com/users/matthiasnoback/following{/other_user}","gists_url":"https://api.github.com/users/matthiasnoback/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiasnoback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiasnoback/subscriptions","organizations_url":"https://api.github.com/users/matthiasnoback/orgs","repos_url":"https://api.github.com/users/matthiasnoback/repos","events_url":"https://api.github.com/users/matthiasnoback/events{/privacy}","received_events_url":"https://api.github.com/users/matthiasnoback/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T07:55:30Z","updated_at":"2015-06-03T07:55:30Z","body":"@acasademont You are completely right. \r\n\r\nAt first I thought this would be a bad change since it might be considered a BC break. However, it's logging, and I think it's reasonable to assume that it no-one would rely on the logging middleware to have a specific priority. Anyway, now it's more like a bug :) So we should fix it."}}