00-database-procs.tcl

  • last updated 1 hour ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
fix typo

db_handle reform

Use "ns_db currenthandles" (when available) to implement "db_with_handle"

instead of the old approach based on the global db_state variables.

The enws approach has the advantantge that it is

- more robust (deletion and creation of the per-request variables,

no coherency problem),

- simpler, and

- faster (less overhead per db_with_handle call, simple queries up to 20% faster)

time {db_string . {select object_id from acs_objects limit 1}} 1000

old: 200-230 microseconds per iteration

new: 160-180 microseconds per iteration

Reduce code duplication (passes automated tests)

improve spelling

  1. … 15 more files in changeset.
Whitespace cleanup

Remove proc doc duplication in 'db_1row'. As the proc is essentially a wrapper for 'db_0or1row', just a pointer is better, avoiding future issues if parameters change.

prefer built-in ns_dbquotevalue over DoubleApos

  1. … 2 more files in changeset.
make former private functions, used in several packages to public functions

  1. … 4 more files in changeset.
fix typo

Port from downstream cache transaction logics and fix automated test as now db_transaction will return 0 instead of the empty string (and no particular return value should be assumed)

  1. … 1 more file in changeset.
reduce hammering on nsv for variables that never change. Use namespaced variables instead.

  1. … 3 more files in changeset.
improve spelling

  1. … 10 more files in changeset.
unify spelling of names

  1. … 3 more files in changeset.
Revert massive replacement of empty list creation sentences. The use of '[list]' instead of '{}' adds semantics that could be used for performance improvements in the future, such as using a different internal representation. There is already work in this direction, avoiding the generation of the string representation during comparison of empty strings (huge thanks to Stefan Sobernig for the pointer: https://core.tcl.tk/tcl/info/44527c632ed609c2).

  1. … 475 more files in changeset.
Rework variable assigning loops (set -> lassign) + Whitespace changes

  1. … 13 more files in changeset.
Prefer '{}' to '[list]' when creating empty lists

  1. … 71 more files in changeset.
improve documentation

  1. … 10 more files in changeset.
Prefer lappend over concat for appending lists (lappend modifies the variable 'in place')

Fix typos

  1. … 23 more files in changeset.
Fix typos

  1. … 62 more files in changeset.
Move deprecated procs into deprecated-procs.tcl

  1. … 10 more files in changeset.
Fix typos

  1. … 2 more files in changeset.
fix debug message

Bug fix: avoid confusion between command argument and option, when argument starts with "-"

  1. … 81 more files in changeset.
merged changes from the oacs-5-9 branch and resolved conflicts

  1. … 7834 more files in changeset.
add self-healing code to reduce number of error messages in error cases

Fix typo in comment

Use per-thread caching instead of nsv for never-changing variable (use ::acs::database_type instead of nsv ad_database_type; when available)

This improves concurrency and performance for tight loops (e.g. in developer support)

  1. … 1 more file in changeset.
Standardize spelling of names of products (Tcl, AOLserver, PostgreSQL, NaviServer)

  1. … 43 more files in changeset.
Fix spelling errors

  1. … 22 more files in changeset.