i'm not sure if this holds true in zodb.
but if you're using SqlAlchemy and didn't do any actual database work,
calling `commit()` has no perceptible effect. sqlalchemy doesn't actually
talk/connect to the database until you do the first query in a session.
in practice...
1. you attach a `dbSession` to `request` with add_request_method +
reify.
2. touching `request.dbSession` will create your new session container
and workspace
3. you could inspect the dict to see it reified, BUT...
4. until you add/query/delete/etc with request.dbSession, it doesn't
actually connect to the database or start a database transaction
calling commit/remove on an unused sqlalchemy session will just do a fairly
fast inspection of the object.
i spent a few hours working on optimizing how my pyramid app interacts with
the database before i realized this was happening already. there's
virtually no overhead involved at all to just calling .commit() or
.rollback() on a session that was unused. from what i remember, it was
actually less of an overhead than calling `get_current_request` from
pyramid ( which is also hugely insignificant )
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.