I'm currently trying to get my applications ready for SQLAlchemy 2.0. A 
change that has forces code changes in numerous places is the removal of 
the automatic addition of new instances to the session upon establishing a 
relationship with an object already in the session. In the explanation of 
the change this is described "not generally a desirable behavior". However, 
it is a behavior on which I currently completely rely for persisting new 
instances. Since, in my system, new instances are always connected to a 
parent object, I never had to add any object explicitly to a session, and 
so session objects are currently basically absent from the application code.

Here are my questions:
- Will there be a way to turn back on this behavior in 2.0? I would be 
thrilled if there was, but I fear the answer is negative.
- How would you recommend dealing with the situation: Either passing 
sessions as additional parameters to any function or method that creates 
new objects, or, calling the session maker within each such function? In 
particular, is there any particular downside to the latter?


-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/792f9a59-2a9f-4dfb-82f0-82ef7f5e4328n%40googlegroups.com.

Reply via email to