allow per-session overriding of internal flags user/gmcharlt/internal_flag
authorGalen Charlton <gmc@esilibrary.com>
Wed, 10 Oct 2012 21:11:25 +0000 (17:11 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 10 Oct 2012 21:26:44 +0000 (17:26 -0400)
commit1263db6406bbae8ae38d0f9e6ec134c53028e087
treec2500632cae91a3b9c61828f089c48a3d5dac8b7
parent0c07adf3290c15647d958fd42524929224bd3b39
allow per-session overriding of internal flags

It can be handy during record ingest to selectively disable
parts of the ingest chain, for example to allow for parallel
record loads, while not interfering with normal cataloging.  This
patch provides a mechanism for per-database-connection overriding
of the enabled state of config.internal_flag values.  Three
new database functions are defined:

* evergreen.override_internal_flag_status(flag, enabled)

Override the enabled status of the specified flag; this override
is visible only to the database connection that invokes this function.

* evergreen.clear_internal_flag_override(flag)

Remove the per-session override on the specified flag.

* evergreen.internal_flag_set(flag)

Returns true if the flag exists and is enabled, taking any per-session
overrides into account.  The intention is that all internal
flag queries should use this wrapper function.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/011.schema.authority.sql
Open-ILS/src/sql/Pg/030.schema.metabib.sql
Open-ILS/src/sql/Pg/110.hold_matrix.sql
Open-ILS/src/sql/Pg/210.schema.serials.sql
Open-ILS/src/sql/Pg/999.functions.global.sql