=pod =head1 NAME UR::Env - Environment variables that control UR behavior =head1 DESCRIPTION UR uses several environment variables to change its behavior or provide additional debugging information. =over 4 =item UR_STACK_DUMP_ON_DIE When true, has the effect of turning any die() into a Carp::confess, meaning a stack dump will be printed after the die message. =item UR_STACK_DUMP_ON_WARN When true, has the effect of turning any warn() into a Carp::cluck, meaning a stack dump will be printed after the warn message. =item UR_CONTEXT_ROOT The name of the Root context to instantiate when the program initializes. The default is UR::Context::DefaultRoot. Other Root Contexts can be used, for example, to connect to alternate databases when running in test mode. =item UR_CONTEXT_BASE This value only changes in a sub-process which goes to its parent process for object I/O instead of the root (which is the default value for the base context in an application). =item UR_CONTEXT_CACHE_SIZE_HIGHWATER Set the object count highwater mark for the object cache pruner. See also L =item UR_CONTEXT_CACHE_SIZE_LOWWATER Set the object count lowwater mark for the object cache pruner. See also L =item UR_DEBUG_OBJECT_RELEASE When true, messages will be printed to STDERR whenever objects are removed from the object cache, such as when the object pruner marks them for removal, when they are garbage collected, unloaded, or deleted. =item UR_DEBUG_OBJECT_RELEASE When true, messages will be printed to STDERR whenever the object pruner finishes its work, and show how many objects of each class were marked for removal. =item UR_CONTEXT_MONITOR_QUERY When true (non-zero), messages will be printed as the Context satisfies queries, such as when get() is called on a class, or while processing an iterator created through SomeClass->create_iterator and iterator->next(). If the value is 1, then only queries about Non-UR classes are printed. If 2, then all queries' information is printed. =item UR_DBI_MONITOR_SQL If this is true, most interactions with data sources such as connecting, disconnecting and querying will print messages to STDERR. Same as Cmonitor_sql()>. Note that this affects non-DBI data sources as well, such as file-based data sources, which will render file I/O information instead of SQL. =item UR_DBI_SUMMARIZE_SQL If true, a report will be printed to STDERR as the program finishes about what SQL queries have been done during the program's execution, and how many times they were executed. This is helpful during optimization. =item UR_DBI_MONITOR_EVERY_FETCH Used in conjunction with UR_DBI_MONITOR_SQL, tells the data sources to also print messages to STDERR for each row fetched from the underlying data source. Same as Cmonitor_every_fetch()>. =item UR_DBI_DUMP_STACK_ON_CONNECT Print a message to STDERR only when connecting to an underlying data source. Same as Cdump_stack_on_connect()> =item UR_DBI_EXPLAIN_SQL_MATCH If the query to a data source matches the given string (interpreted as a regex), then it will attempt to do an "explain plan" and print the results before executing the query. Same as Cexplain_sql_match()> =item UR_DBI_EXPLAIN_SQL_SLOW If the time between a prepare and the first fetch of a query is longer than the given number of seconds, then it will do an "explain plan" and print the results. Same as Cexplain_sql_slow()> =item UR_DBI_EXPLAIN_SQL_CALLSTACK Used in conjunction with UR_DBI_EXPLAIN_SQL_MATCH and UR_DBI_EXPLAIN_SQL_SLOW, prints a stack trace with Carp::longmess. Same as Cexplain_sql_callstack()> =item UR_DBI_MONITOR_DML Like UR_DBI_MONITOR_SQL, but only prints information during data-altering statements, like INSERT, UPDATE or DELETE. Same as Cmonitor_dml()> =item UR_DBI_NO_COMMIT If true, data source commits will be ignored. Note that saving still occurs. If you are working with a RDBMS database, this means During UR::Context->commit(), the insert, update and delete SQL statements will be issued, but the changes will not be committed. Useful for testing. Same as Cno_commit()> =item UR_USE_DUMMY_AUTOGENERATED_IDS If true, objects created without ID params will use a special algorithm to generate IDs. Objects with these special IDs will never be saved to a data source. Useful during testing. Same as Cuse_dummy_autogenerated_ids> =item UR_USED_LIBS If true, prints a message to STDERR with the contents of @INC just before the program exits. =item UR_USED_MODS If true, prints a message to STDERR with the keys of %INC just before the program exits. This will be a list of what modules had been loaded during the life of the program. If UR_USED_MODS is greater than 1, then it will show the key/value pairs of %INC, which will show the path each module was loaded from. =back =cut