If you are running with AUTOCOMMIT=0 then your changes in BDB tables will not be updated until you execute COMMIT. Instead of commit you can execute ROLLBACK to forget your changes. See COMMIT.
If you are running with AUTOCOMMIT=1 (the default), your changes will be committed immediately. You can start an extended transaction with the BEGIN WORK SQL command, after which your changes will not be committed until you execute COMMIT (or decide to ROLLBACK the changes).
The following options to mysqld can be used to change the behavior of BDB tables:
Option | Description |
--bdb-home=directory | Base directory for BDB tables. This should be the same directory you use for --datadir. |
--bdb-lock-detect=# | Berkeley lock detection method. One of (DEFAULT, OLDEST, RANDOM, or YOUNGEST). |
--bdb-logdir=directory | Berkeley DB log file directory. |
--bdb-no-sync | Don't synchronously flush logs. |
--bdb-no-recover | Don't start Berkeley DB in recover mode. |
--bdb-shared-data | Start Berkeley DB in multi-process mode (Don't use DB_PRIVATE when initializing Berkeley DB) |
--bdb-tmpdir=directory | Berkeley DB temporary file directory. |
--skip-bdb | Disable usage of BDB tables. |
-O bdb_max_lock=1000 | Set the maximum number of locks possible. See bdb_max_lock. |
If you use --skip-bdb, MySQL will not initialize the Berkeley DB library and this will save a lot of memory. You cannot use BDB tables if you are using this option. If you try to create a BDB table, MySQL will instead create a MyISAM table.
Normally you should start mysqld without --bdb-no-recover if you intend to use BDB tables. This may, however, give you problems when you try to start mysqld if the BDB log files are corrupted. See Starting server.
With bdb_max_lock you can specify the maximum number of locks (10000 by default) you can have active on a BDB table. You should increase this if you get errors of type bdb: Lock table is out of available locks or Got error 12 from ... when you have do long transactions or when mysqld has to examine a lot of rows to calculate the query.
You may also want to change binlog_cache_size and max_binlog_cache_size if you are using big multi-line transactions. See COMMIT.