diff options
| author | Ants Aasma <ants.aasma@gmail.com> | 2008-01-20 03:39:43 +0000 |
|---|---|---|
| committer | Ants Aasma <ants.aasma@gmail.com> | 2008-01-20 03:39:43 +0000 |
| commit | f645c0a420c2253f13d04b48a6037cbd52b75e2f (patch) | |
| tree | 3ee468c952e36f63efb75e8c832674d678ced6ee | |
| parent | 9f366afdda4b508eb4ef3e626da2fec98ad04773 (diff) | |
| download | sqlalchemy-f645c0a420c2253f13d04b48a6037cbd52b75e2f.tar.gz | |
example of using try-catch to do transaction commit/rollback was wrong in the docs
| -rw-r--r-- | doc/build/content/session.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/build/content/session.txt b/doc/build/content/session.txt index e17987cf5..d44bef50d 100644 --- a/doc/build/content/session.txt +++ b/doc/build/content/session.txt @@ -460,10 +460,10 @@ Alternatively, a transaction can be begun explicitly using `begin()`: item2 = sess.query(Item).get(2) item1.foo = 'bar' item2.bar = 'foo' + sess.commit() except: sess.rollback() raise - sess.commit() Session also supports Python 2.5's with statement so that the example above can be written as: |
