head 1.2; access; symbols RPM_4_2_1:1.1.1.5 RPM_4_2:1.1.1.5 RPM_4_1_1:1.1.1.5 RPM_4_1:1.1.1.4 RPM_4_0_5:1.1.1.3 RPM_4_0_4:1.1.1.2 RPM_4_0_3:1.1.1.1 RPM:1.1.1; locks; strict; comment @# @; 1.2 date 2008.01.02.09.58.55; author rse; state dead; branches; next 1.1; commitid z4cpSiAhOCXk5PLs; 1.1 date 2001.05.13.19.58.32; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.05.13.19.58.32; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2002.01.07.22.30.58; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2003.01.18.13.49.10; author rse; state Exp; branches; next 1.1.1.4; 1.1.1.4 date 2001.10.15.03.47.27; author rse; state Exp; branches; next 1.1.1.5; 1.1.1.5 date 2003.01.18.14.05.14; author rse; state Exp; branches; next ; desc @@ 1.2 log @remove the ancient RPM 4.2.1 source tree copy @ text @

Environment Commands

Environments provide a structure for creating a consistent environment for processes using one or more of the features of Berkeley DB.  Unlike some of the database commands, the environment commands are very low level.

The user may create and open a new DB environment  by invoking:

> berkdb env
    [-cdb] [-cdb_alldb] [-lock] [-log] [-txn [nosync]]
    [-create] [-home directory] [-mode mode]
    [-data_dir directory] [-log_dir directory] [-tmp_dir directory]
    [-nommap] [-private] [-recover] [-recover_fatal] [-system_mem] [-errfile filename]
    [-use_environ] [-use_environ_root] [-verbose {which on|off}]
    [-region_init]
    [-cachesize {gbytes bytes ncaches}]
    [-mmapsize size]
    [-log_max max]
    [-log_buffer size]
    [-lock_conflict {nmodes {matrix}}]
    [-lock_detect default|oldest|random|youngest]
    [-lock_max max]
    [-lock_max_locks max]
    [-lock_max_lockers max]
    [-lock_max_objects max]
    [-txn_max max]
    [-client_timeout seconds]
    [-server_timeout seconds]
    [-server hostname]
 

This command opens up an environment.   We automatically set the DB_THREAD and the DB_INIT_MPOOL flags.  The arguments are:

This command will invoke the db_env_create function.  After it successfully gets a handle to an environment, we bind it to a new Tcl command of the form envX, where X is an integer starting at  0 (e.g. env0, env1, etc).  We use the Tcl_CreateObjCommand() to create the top level environment command function.  It is through this handle that the user can access all the commands described in the Environment Commands section.  Internally, the handle we get back from DB will be stored as the ClientData portion of the new command set so that all future environment calls will have that handle readily available.  Then we call the DBENV->open method call and possibly some number of setup calls as described above.



> <env> verbose which on|off

This command controls the use of debugging output for the environment.  This command directly translates to a call to the DBENV->set_verbose method call.  It returns either a 0 (for success), a DB error message or it throws a Tcl error with a system message.  The user specifies which subsystem to control, and indicates whether debug messages should be turned on or off for that subsystem.  The value of which must be one of the following:


> <env> close

This command closes an environment and deletes the handle.  This command directly translates to a call to the DBENV->close method call.  It returns either a 0 (for success), a DB error message or it throws a Tcl error with a system message.

Additionally, since the handle is no longer valid, we will call Tcl_DeleteCommand() so that further uses of the handle will be dealt with properly by Tcl itself.

Also, the close command will automatically abort any transactions and close any mpool memory files.  As such we must maintain a list of open transaction and mpool handles so that we can call Tcl_DeleteCommand on those as well.



> berkdb envremove [-data_dir directory] [-force] [-home directory] -log_dir directory] [-tmp_dir directory] [-use_environ] [-use_environ_root]

This command removes the environment if it is not in use and deletes the handle.  This command directly translates to a call to the DBENV->remove method call.  It returns either a 0 (for success), a DB error message or it throws a Tcl error with a system message.  The arguments are:

@ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @Import: RPM 4.0.3 @ text @@ 1.1.1.2 log @Import: RPM 4.0.4 @ text @d1 7 a7 7 d9 2 a10 2

Environment Commands

d14 29 a42 33

The user may create and open a new DB environment  by invoking:

> berkdb env
    [-cdb] [-cdb_alldb] [-lock] [-log] [-txn [nosync]]
    [-create] [-home directory] [-mode mode]
    [-data_dir directory] [-log_dir directory] [-tmp_dir directory]
    [-nommap] [-private] [-recover] [-recover_fatal] [-system_mem] [-errfile filename]
    [-use_environ] [-use_environ_root] [-verbose {which on|off}]
    [-region_init]
    [-cachesize {gbytes bytes ncaches}]
    [-mmapsize size]
    [-log_max max]
    [-log_buffer size]
    [-lock_conflict {nmodes {matrix}}]
    [-lock_detect default|oldest|random|youngest]
    [-lock_max max]
    [-lock_max_locks max]
    [-lock_max_lockers max]
    [-lock_max_objects max]
    [-lock_timeout timeout]
    [-txn_max max]
    [-txn_timeout timeout]
    [-client_timeout seconds]
    [-server_timeout seconds]
    [-server hostname]
    [-rep_master] [-rep_client]
    [-rep_transport { machineid sendproc }]
 

This command opens up an environment.   We automatically set d44 172 a215 198

This command will invoke the db_env_create d217 3 a219 3 we bind it to a new Tcl command of the form envX, where X is an integer starting at  0 (e.g. env0, env1, etc).  We use the Tcl_CreateObjCommand() to create the top level environment d221 3 a223 3 all the commands described in the Environment Commands section.  Internally, the handle we get back from DB will be stored as the ClientData portion of the new command set d225 1 a225 1 Then we call the DBENV->open d227 6 a232 6



> <env> verbose which on|off

This command controls the use of debugging output for the environment.  This command directly translates to a call to the DBENV->set_verbose d235 1 a235 1 which d237 2 a238 2 on or off for that subsystem.  The value of which d240 21 a260 21


> <env> close

This command closes an environment and deletes the handle.  This command directly translates to a call to the DBENV->close d263 2 a264 2

Additionally, since the handle is no longer valid, we will call Tcl_DeleteCommand() so d266 2 a267 2

Also, the close command will automatically abort any transactions and close any mpool memory files.  As such d269 8 a276 8 can call Tcl_DeleteCommand on those as well.



> berkdb envremove [-data_dir directory] [-force] [-home directory] -log_dir directory] [-tmp_dir directory] [-use_environ] [-use_environ_root]

This command removes the environment if it is not in use and deletes the handle.  This command directly translates to a call to the DBENV->remove d279 27 a305 27

d307 2 a308 2 @ 1.1.1.3 log @Import: RPM 4.0.5 @ text @d1 1 a1 2 a37 1
    [-overwrite] a205 3 -overwrite sets DB_OVERWRITE flag
  • d302 3 a304 11 > berkdb envremove
    [-data_dir directory]
    [-force]
    [-home directory]
    [-log_dir directory]
    [-overwrite]
    [-tmp_dir directory]
    [-use_environ]
    [-use_environ_root]
    a323 3
  • -overwrite sets DB_OVERWRITE flag
  • @ 1.1.1.4 log @Import: RPM 4.1 @ text @d1 2 a2 1 d39 1 d208 3 d307 11 a317 3
    > berkdb envremove [-data_dir directory] [-force] [-home directory] -log_dir directory] [-tmp_dir directory] [-use_environ] [-use_environ_root] d337 3 @ 1.1.1.5 log @Import: RPM 4.1.1 @ text @d1 1 a1 2 a37 1
        [-overwrite] a205 3 -overwrite sets DB_OVERWRITE flag
  • d302 3 a304 11 > berkdb envremove
    [-data_dir directory]
    [-force]
    [-home directory]
    [-log_dir directory]
    [-overwrite]
    [-tmp_dir directory]
    [-use_environ]
    [-use_environ_root]
    a323 3
  • -overwrite sets DB_OVERWRITE flag
  • @