From f645c0a420c2253f13d04b48a6037cbd52b75e2f Mon Sep 17 00:00:00 2001 From: Ants Aasma Date: Sun, 20 Jan 2008 03:39:43 +0000 Subject: [PATCH] example of using try-catch to do transaction commit/rollback was wrong in the docs --- doc/build/content/session.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/build/content/session.txt b/doc/build/content/session.txt index e17987cf53..d44bef50d9 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: -- 2.47.3