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

2015-02-09 Thread Michael Bayer
Russ russandheat...@gmail.com wrote: I have a case where I 'm using threadlocal scoped_sessions and I'm storing a file during a transaction. I want to delete the file if the transaction rolls back for any reason. To handle this I use the event system, something like so: def

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

2015-02-09 Thread Russ
I have a case where I 'm using threadlocal scoped_sessions and I'm storing a file during a transaction. I want to delete the file if the transaction rolls back for any reason. To handle this I use the event system, something like so: def write_data(file_path, data): with

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

2015-02-09 Thread Russ
do you mean to say event.listen(ormSess) here ? Sorry... yes. Poor transcription/reduction. 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, and that Session is hit by