[SQL-CVS] r4737 - SQLObject/branches/1.6/docs
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2014-05-11 16:05:19
|
Author: phd Date: Sun May 11 10:05:12 2014 New Revision: 4737 Log: Backport revision 4732 from branch 1.7: document sqlhub.doInTransaction Modified: SQLObject/branches/1.6/docs/SQLObject.txt Modified: SQLObject/branches/1.6/docs/SQLObject.txt ============================================================================== --- SQLObject/branches/1.6/docs/SQLObject.txt Sun May 11 10:04:14 2014 (r4736) +++ SQLObject/branches/1.6/docs/SQLObject.txt Sun May 11 10:05:12 2014 (r4737) @@ -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 --------------------------- |