[sqlalchemy] move objects between two sessions

2017-04-09 Thread SG
I have two databases with one session for each of them. I would like to move objects contained in one of them to the other. I tried to get an object from the first with something like: obj = sessionA.query(MyClass).filter(MyClass.name == 'some name') and then I tried to add this object to the

[sqlalchemy] Control connection timeout of MySQL client from SQLAlchemy

2017-03-31 Thread SG
I have a system composed by client where runs sqlalchemy and a remote server where runs MySQL server database. With sqlalchemy I use to setup session: # db_host is the ip address of remote server db_url = 'mysql+mysqldb://db_user:db_pswd@db_host/db_name' db_engine =