Index: openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl,v diff -u -r1.103.2.1 -r1.103.2.2 --- openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 15 Aug 2015 05:15:35 -0000 1.103.2.1 +++ openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 9 Oct 2015 15:48:09 -0000 1.103.2.2 @@ -263,7 +263,7 @@ ::xo::db::Driver abstract instproc list {{-dbn ""} qn sql} ::xo::db::Driver abstract instproc dml {{-dbn ""} qn sql} ::xo::db::Driver abstract instproc foreach {{-dbn ""} qn sql script} - ::xo::db::Driver abstract instproc transaction {{-dbn ""} script} + ::xo::db::Driver abstract instproc transaction {{-dbn ""} script args} ::xo::db::Driver abstract instproc ds {onOff} # @@ -342,8 +342,20 @@ if {$sql eq ""} {set sql [my get_sql $qn]} return [my uplevel [list ::dbi_dml $sql]] } - ::xo::db::DBI instproc transaction {{-dbn ""} script} { - return [my uplevel [list ::dbi_eval -transaction committed $script]] + ::xo::db::DBI instproc transaction {{-dbn ""} script args} { + if {$args ne ""} { + lassign $args op on_error_code + set result "" + if {$op ne "on_error"} {error "only 'on_error' as argument afer script allowed"} + if {[catch { + set result [my uplevel [list ::dbi_eval -transaction committed $script]] + }]} { + my uplevel $on_error_code + } + return $result + } else { + return [my uplevel [list ::dbi_eval -transaction committed $script]] + } } ::xo::db::DBI instproc get_value {{-dbn ""} qn sql {default ""}} { @@ -423,8 +435,8 @@ # built-in } - ::xo::db::DB instproc transaction {{-dbn ""} script} { - return [my uplevel [list ::db_transaction -dbn $dbn $script]] + ::xo::db::DB instproc transaction {{-dbn ""} script args} { + return [my uplevel [list ::db_transaction -dbn $dbn $script {*}$args]] } ::xo::db::DB instproc sets {{-dbn ""} qn sql} { Index: openacs-4/packages/xotcl-core/tcl/context-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/context-procs.tcl,v diff -u -r1.65.2.1 -r1.65.2.2 --- openacs-4/packages/xotcl-core/tcl/context-procs.tcl 18 Aug 2015 17:33:59 -0000 1.65.2.1 +++ openacs-4/packages/xotcl-core/tcl/context-procs.tcl 9 Oct 2015 15:48:09 -0000 1.65.2.2 @@ -347,12 +347,7 @@ # for requests bypassing the ordinary connection setup (resources in oacs 5.2+) # we have to get the user_id by ourselves if { [catch { - if {[info commands ad_cookie] ne ""} { - # we have the xotcl-based cookie code - set cookie_list [ad_cookie get_signed_with_expr "ad_session_id"] - } else { - set cookie_list [ad_get_signed_cookie_with_expr "ad_session_id"] - } + set cookie_list [ad_get_signed_cookie_with_expr "ad_session_id"] set cookie_data [split [lindex $cookie_list 0] {,}] set untrusted_user_id [lindex $cookie_data 1] set requestor $untrusted_user_id