Index: openacs-4/packages/acs-tcl/tcl/security-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-tcl/tcl/security-procs-oracle.xql 1 Mar 2002 15:01:02 -0000 1.4 +++ openacs-4/packages/acs-tcl/tcl/security-procs-oracle.xql 1 Mar 2002 23:16:13 -0000 1.5 @@ -52,30 +52,30 @@ - + - - insert into sec_session_properties - (session_id, module, property_name, property_value, property_clob, secure_p, last_hit) - values ( :session_id, :module, :name, null, empty_clob(), :secure, :last_hit ) - returning property_clob into :1 - + update sec_session_properties + set property_value = null, + property_clob = empty_clob(), + secure_p = :secure, + last_hit = :last_hit + where session_id = :session_id and + module = :module and + property_name = :name + returning property_clob into :1 - - + - update sec_session_properties - set property_value = null, - property_clob = empty_clob(), - secure_p = :secure, - last_hit = :last_hit - where session_id = :session_id and - module = :module and - property_name = :name - returning property_clob into :1 - + update sec_session_properties + set property_value = :value, + property_clob = null, + secure_p = :secure, + last_hit = :last_hit + where session_id = :session_id and + module = :module and + property_name = :name Index: openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql 29 Dec 2001 01:48:32 -0000 1.8 +++ openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql 1 Mar 2002 23:16:13 -0000 1.9 @@ -2,6 +2,19 @@ postgresql7.1 + + + + update sec_session_properties + set property_value = :value, + secure_p = :secure, + last_hit = :last_hit + where session_id = :session_id and + module = :module and + property_name = :name + + + Index: openacs-4/packages/acs-tcl/tcl/security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-tcl/tcl/security-procs.tcl 1 Mar 2002 15:01:02 -0000 1.7 +++ openacs-4/packages/acs-tcl/tcl/security-procs.tcl 1 Mar 2002 23:16:13 -0000 1.8 @@ -395,19 +395,19 @@ # was discovered on a page built of frames, where the two requests from # the browser spawned two AOLserver threads to service them. - # This code's a bit crude in that we assume the only error we get will - # be due to a unique violation, so be careful if you edit the queries! + # Oracle doesn't allow a RETURNING clause on an insert with a + # subselect, so this code first inserts a dummy value if none exists + # (ensuring it does exist afterwards) then updates it with the real + # value. Ugh. - set clob_insert_dml [db_map prop_insert_dml_clob] + set clob_update_dml [db_map prop_update_dml_clob] - if { $clob == "t" && ![empty_string_p $clob_insert_dml] } { - if { [catch {db_dml dummy $clob_insert_dml -clobs [list $value]} errmsg] } { - db_dml prop_update_dml_clob "" -clobs [list $value] - } + db_dml prop_insert_dml "" + + if { $clob == "t" && ![empty_string_p $clob_update_dml] } { + db_dml prop_update_dml_clob "" -clobs [list $value] } else { - if { [catch {db_dml prop_insert_dml ""} ] } { - db_dml prop_update_dml "" - } + db_dml prop_update_dml "" } } } Index: openacs-4/packages/acs-tcl/tcl/security-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-tcl/tcl/security-procs.xql 1 Mar 2002 15:01:02 -0000 1.4 +++ openacs-4/packages/acs-tcl/tcl/security-procs.xql 1 Mar 2002 23:16:13 -0000 1.5 @@ -36,39 +36,26 @@ - - - - - insert into sec_session_properties - (session_id, module, property_name, property_value, secure_p, last_hit) - values ( :session_id, :module, :name, :value, :secure, :last_hit ) - - - - - + - - update sec_session_properties - set property_value = :value, - property_clob = null, - secure_p = :secure, - last_hit = :last_hit - where session_id = :session_id and - module = :module and - property_name = :name - + select token from secret_tokens + where token_id = :token_id - + - select token from secret_tokens - where token_id = :token_id + insert into sec_session_properties + (session_id, module, property_name, secure_p, last_hit) + select :session_id, :module, :name, :secure, :last_hit + from dual + where not exists (select 1 + from sec_session_properties + where session_id = :session_id and + module = :module and + property_name = :name) -