6 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: PROPOSAL: Session
FromSent OnAttachments
Michael Bayer29 Jul 2007 13:36 
Michael Bayer29 Jul 2007 20:17 
sdob...@sistechnology.com29 Jul 2007 23:55 
Michael Bayer30 Jul 2007 07:18 
sdob...@sistechnology.com30 Jul 2007 11:13 
Michael Bayer30 Jul 2007 13:24 
Subject:[sqlalchemy] Re: PROPOSAL: Session
From:sdob...@sistechnology.com (sdob@sistechnology.com)
Date:07/29/2007 11:55:23 PM
List:com.googlegroups.sqlalchemy

On Sunday 29 July 2007 23:36:32 Michael Bayer wrote:

This would be a new name available in 0.4 which would produce the same Session that we are familiar with, except it would be by default transactional and autoflushing. The create_session() function stays around and does what it always did, producing a regular session which you flush().

while we have both Session() and create_session() in the trunk now, Session() would be what we document going forward. flags to make it act other ways are still available, like autoflush/transactional.

any thoughts ?

as long as u have both ways (autoflush/noauto, trans/notrans) on same object - flags etc - and the difference is well documented, and the usage patterns of both (or are there 4 combinations) are explained...

will the readonly= flag go in too?

btw is autoflushing meaning that .save always calls .flush, instance-per-instance? Then how about making sess.save working over list or *args and saving them all? (may be another method savemany that just calls save in a loop)

And, would this mean that in an autoflushing session calling .flush is useless (being called anyway after each .save automaticaly)? hmm. then just make .flush to issue .commit... (i know about different semantics etc, but most people do not want the semantix, they just want the data going to db). Maybe even add another method meaning either .flush for (trans=0, autoflush=whatever) or .commit for (trans=1, autoflush=1), or .flush then .commit for (trans=1, autoflush=0).

heh, this transactional Session() will make the antipattern 'just one-loooooooong-session' appear somewhat different...