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 -r1.19.2.3 -r1.19.2.4 --- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 5 Mar 2003 14:40:42 -0000 1.19.2.3 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 6 Mar 2003 17:37:07 -0000 1.19.2.4 @@ -839,21 +839,40 @@ # An error was triggered or the transaction has been aborted. 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. + + # DRB: I removed the db_release_unused_handles call that + # this patch included because additional aborts further + # down triggered an illegal db handle error. I'm going to + # have the code start a new transaction as well. If we + # don't, if a transaction fails and the on_error block + # fails, the on_error block DML will have been committed. + # Starting a new transaction here means that DML by both + # the transaction and on_error clause will be rolled back. + # On the other hand, if the on_error clause doesn't fail, + # any DML in that block will be committed. This seems more + # useful than simply punting ... + ns_db dml $dbh "abort transaction" - db_release_unused_handles + ns_db dml $dbh "begin transaction" + } + + # An on_error block exists, so execute it. + set errno [catch { uplevel 1 $on_error } on_errmsg] + # Determine what do with the error. set err_p 0 switch $errno { Index: openacs-4/packages/acs-tcl/tcl/openacs-kernel-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/openacs-kernel-procs.tcl,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/acs-tcl/tcl/openacs-kernel-procs.tcl 15 May 2002 04:19:00 -0000 1.4 +++ openacs-4/packages/acs-tcl/tcl/openacs-kernel-procs.tcl 6 Mar 2003 17:37:08 -0000 1.4.2.1 @@ -114,7 +114,6 @@ for {set i 0} {$i < $n_fields} {incr i} { set varname [string tolower [lindex $headers $i]] set varvalue [lindex $one_line $i] - set row_array($varname) $varvalue }