better one to use from engine is begin() (also new in 0.7.6):
with engine.begin() as conn:
...
that way everything you do with conn is on the same transaction.
On Apr 9, 2012, at 5:39 PM, Claudio Freire wrote:
> On Mon, Apr 9, 2012 at 4:36 PM, Michael Bayer <[email protected]>
> wrote:
>> Using context managers, i.e. "with engine.connect() as conn", is the most
>> straightforward.
>
> IIRC, context managers are new in SA, aren't they?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To post to this group, send email to [email protected].
> 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.
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
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.