[sqlalchemy] Re: Old event listeners firing on the wrong session?

2015-02-09 Thread Jonathan Vanasco
I just wanted to suggest another approach that may work, at least as a fallback. When I upload files to Amazon S3 I track the activity in a logging table (via sqlalchemy) that looks a bit like this: id | filename | timestamp_upload_start | upload_status (bool) | timestamp_deleted Before

[sqlalchemy] Re: Old event listeners firing on the wrong session?

2015-02-09 Thread Russ
Problem solved. Michael - you nailed it when you guessed: if you have set an event listener on a single session that is definitely the actual Session object and not the thread local or the scoped_session or anything sa.event.listen was being passed the scoped_session instance, not an

[sqlalchemy] Re: Old event listeners firing on the wrong session?

2015-02-09 Thread Russ
Thanks for the idea, Jonathan! I was actually discussing such a fallback watchdog on #postgresql earlier today. Now that I've been having event troubles and it is highlighting atomicity issues with the db/filesystem split, I'm definitely going to implement such a safety net. I think the