Index: openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl,v diff -u -N -r1.9.2.4 -r1.9.2.5 --- openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl 4 Feb 2017 14:08:13 -0000 1.9.2.4 +++ openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl 21 May 2017 09:19:36 -0000 1.9.2.5 @@ -232,14 +232,19 @@ ns_db releasehandle $db if { $this_suffix eq "" } { ns_log Notice "$proc_name: couldn't determine RDBMS type of database pool \"$pool\"." - lappend bad_pools "
  • OpenACS could not determine the RDBMS type associated with - pool \"$pool\"." + lappend bad_pools "
  • OpenACS could not determine the RDBMS type associated with pool \"$pool\"." set long_error 1 } elseif { [nsv_get ad_database_type .] eq "" } { nsv_set ad_database_type . $this_suffix + # + # For the time being, keep the info in the nsv for + # backwards compatibility and and a version in a + # per-thead (namespaced) variable + # + set ::acs::database_type $this_suffix + } elseif { ![string match $this_suffix [nsv_get ad_database_type .]] } { - ns_log Notice "$proc_name: Database pool \"$pool\" type \"$this_suffix\" differs from - \"[nsv_get ad_database_type .]\"." + ns_log Notice "$proc_name: Database pool \"$pool\" type \"$this_suffix\" differs from \"[nsv_get ad_database_type .]\"." lappend bad_pools "
  • Database pool \"$pool\" is of type \"$this_suffix\". The first database pool available to OpenACS was of type \"[nsv_get ad_database_type .]\". All database pools must be configured to use the same RDMBS engine, user and database." 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.88.2.17 -r1.88.2.18 --- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 22 Apr 2017 18:11:54 -0000 1.88.2.17 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 21 May 2017 09:19:36 -0000 1.88.2.18 @@ -236,12 +236,24 @@ ad_proc -public db_type {} { - @return the RDBMS type (i.e. oracle, postgresql) this OpenACS installation is using. The nsv ad_database_type is set up during the bootstrap process. + @return the RDBMS type (i.e. oracle, postgresql) this OpenACS installation is using. + The nsv ad_database_type is set up during the bootstrap process. } { + # # Currently this should always be either "oracle" or "postgresql": # --atp@piskorski.com, 2003/03/16 22:01 EST - - return [nsv_get ad_database_type .] + # + # First check, if the database type exists in the namespaced + # variable. This should be always the case. If this fail, fall + # back to the old-style nsv (which can be costly in tight db loops) + # + if {[info exists ::acs::database_type]} { + set result $::acs::database_type + } else { + set result [nsv_get ad_database_type .] + ns_log Warning "db_type '$result' had to be obtained from the nsv 'ad_database_type'" + } + return $result } ad_proc -public db_compatible_rdbms_p { db_type } {