[SQL-CVS] r4732 - SQLObject/branches/1.7/docs
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2014-05-10 18:17:59
|
Author: phd Date: Sat May 10 12:17:50 2014 New Revision: 4732 Log: Document sqlhub.doInTransaction Modified: SQLObject/branches/1.7/docs/SQLObject.txt Modified: SQLObject/branches/1.7/docs/SQLObject.txt ============================================================================== --- SQLObject/branches/1.7/docs/SQLObject.txt Fri May 9 11:47:30 2014 (r4731) +++ SQLObject/branches/1.7/docs/SQLObject.txt Sat May 10 12:17:50 2014 (r4732) @@ -1432,6 +1432,13 @@ Person.select(Person.q.name=="value", forUpdate=True, connection=trans) +Method ``sqlhub.doInTransaction`` can be used to run a piece of code in +a transaction. The method accepts a callable and positional and keywords +arguments. It begins a transaction using its ``processConnection`` or +``threadConnection``, calls the callable, commits the transaction and +closes the underlying connection; it returns whatever the callable +returned. If an error occurs during call to the callable it rolls the +transaction back and reraise the exception. Automatic Schema Generation --------------------------- |