Index: openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 10 Sep 2002 22:22:14 -0000 1.18 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 23 Sep 2002 11:21:34 -0000 1.19 @@ -819,7 +819,7 @@ } 3 { # TCL_BREAK - Abort the transaction and do the break. - ns_db dml $db "abort transaction" + ns_db dml $dbh "abort transaction" db_release_unused_handles break } @@ -837,6 +837,17 @@ db_abort_transaction if { [info exists on_error] && ![empty_string_p $on_error] } { # An on_error block exists, so execute it. + if {[string equal postgresql [db_type]]} { + # JCD: with postgres we abort the transaction prior to + # executing the on_error block since there is nothing + # you can do to "fix it" and keeping it meant things like + # queries in the on_error block would then fail. + # + # Note that the semantics described in the proc doc + # are not possible to support on postresql. + ns_db dml $dbh "abort transaction" + db_release_unused_handles + } set errno [catch { uplevel 1 $on_error } on_errmsg] @@ -852,7 +863,7 @@ } 3 { # TCL_BREAK - ns_db dml $db "abort transaction" + ns_db dml $dbh "abort transaction" db_release_unused_handles break }