Re: [sqlalchemy] Sending queue messages/emails after model commit

2014-09-23 Thread Alex Michael
Hey Jason, Thanks for your reply. That makes sense I guess. It just feels like this is something most webapps will need at some point and it's not as straightforward as someone would imagine. -- alex On Monday, September 22, 2014 6:22:14 PM UTC+2, jason kirtland wrote: Hi Alex, I have a

[sqlalchemy] Sending queue messages/emails after model commit

2014-09-22 Thread Alex Michael
Hey, From my understanding it's recommended that the business logic does not commit the session and that the application itself handles the session lifecycle. Following that, I have all the session handling logic in my controllers so the business logic just changes the objects as necessary

Re: [sqlalchemy] Sending queue messages/emails after model commit

2014-09-22 Thread jason kirtland
Hi Alex, I have a similar use case, and fixed it by buffering the signals until the session transaction completes. On rollback, the buffered signals are discarded; on successful commit, the signals are truly emitted. Cheers, Jason On Mon, Sep 22, 2014 at 2:20 AM, Alex Michael