Menu

Commit [r6421]  Maximize  Restore  History

WikiRename: simplify transaction handling in the Wiki model

The !WikiPage public API is not modified. A helper `transaction` function is used to factor out the `handle_ta` business. Its usage is very simple:
- if the function is given a database connection, it will simply execute the callback as part of another transaction,
- if the function has to retrieve a new database connection, it takes responsibility to either `commit` the changes performed by the callback or to `rollback` them, if any exception was raised.

TODO: similar changes could apply to `trac.ticket.model`

cboos 2008-01-28

changed /sandbox/wiki-rename/trac/attachment.py
changed /sandbox/wiki-rename/trac/db/util.py
changed /sandbox/wiki-rename/trac/wiki/model.py
/sandbox/wiki-rename/trac/attachment.py Diff Switch to side-by-side view
Loading...
/sandbox/wiki-rename/trac/db/util.py Diff Switch to side-by-side view
Loading...
/sandbox/wiki-rename/trac/wiki/model.py Diff Switch to side-by-side view
Loading...