Posted to tcl by kbk at Sun Jul 20 20:53:26 GMT 2008view raw
- method transaction {script} {
- my begintransaction
- set status [catch {uplevel 1 $script} result options]
- switch -exact -- $status {
- 0 {
- my commit
- }
- 2 - 3 - 4 {
- set options [dict merge {-level 1} $options[set options {}]]
- dict incr options -level
- my commit
- }
- default {
- my rollback
- }
- }
- return -options $options $result
- }