[sqlalchemy] Is it safe to re-use a closed session?

2018-04-05 Thread 'Brian Candler' via sqlalchemy
The documentation doesn't seem to be 100% clear on this point: if you close() a session, can you continue to use it as if it were a fresh session? (Unlike say a closed filehandle) In other words, in a non-threaded application, is this a

[sqlalchemy] When is session.close required?

2017-05-23 Thread 'Brian Candler' via sqlalchemy
Hello, I have a question about when "close" should or should not be called on a session. At http://docs.sqlalchemy.org/en/latest/orm/session_transaction.html it says: "When the transactional state is completed after a rollback or commit, the Session releases all Transaction and Connection

[sqlalchemy] Reproducible oddity in with_for_update()

2015-06-15 Thread Brian Candler
I have an issue which I have boiled down to a full test case below. This test program reproduces the problem with both sqlalchemy 0.9.9 and 1.0.5, under python 2.7.6 and ubuntu 14.04, and PyMySQL-0.6.2. There are a combination of circumstances: 1. After you rollback a session, touching any