On Friday 20 June 2008 17:38:25 Michael Bayer wrote:
> On Jun 19, 2008, at 5:57 PM, Martijn Faassen wrote:
> > Hi there,
> >
> > I just noticed on the trunk that on sessionmaker(), autocommit
> > defaults
> > to False, but autocommit defaults to True when you use
> > create_session. autoflush is also True for sessionmaker, but for
> > create_session, it's False.  Finally autoexpire is True for
> > sessionmaker, but False for create_session.
> >
> > Is this intentional?
>
> create_session() is the "original" session creation function, which
> creates a session with none of the "newer" things added on, i.e.
> autocommit=False, autoexpire, autoflush.  This is for backwards
> compatibility reasons, both within the unit test suite as well as
> lots of examples, user scripts, etc.    The unit tests in
> particular were built around the notion of an "unadulterated"
> session that isn't doing things implicitly.   The Session's
> behavior has changed over the course of SQLA's lifespan from being
> a relatively "dumb" container that doesn't make any decisions
> whatsoever to one which does what the large majority of use cases
> would prefer; this is a product of us being around for awhile and
> watching lots of people use it for a couple of years.
>
> I just noticed that the 0.5 docs still have a prominent
> "create_session()" section, which I'm assuming is how you came
> across it.    I think the solution here at the least would be to
> remove prominent advertisement of "create_session()".  I'm not sure
> yet about deprecation/non-publicizing it.  I still think its a
> useful function for ad-hoc creation of sessions with no extra
> behavior but this may very well be just my skewed view of it.

move it in some convenience.py? 
together with other such non-mandatory but convenient shortcuts that 
most people would make in one form or another

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to