Berkeley DB 4.1.24 and 4.1.25 Change Log

Database or Log File On-Disk Format Changes:

All of the access method database formats changed in the Berkeley DB 4.1 release (Btree/Recno: version 8 to version 9, Hash: version 7 to version 8, and Queue: version 3 to version 4).
The format changes are entirely backward compatible, and no database upgrades are needed.

Major New Features:

Berkeley DB now includes support for database encryption using the AES encryption standard. [#1797]

Berkeley DB now includes support for database page checksums to allow detection of database corruption during I/O. [#1797]

General Access Method Changes:

Allow applications to specify transaction handles to the DB->associate method call, so secondary index creation can be grouped with other Berkeley DB calls in a single transaction. [#4185]

Add a new flag, DB_AUTO_COMMIT, that wraps single database operations inside a transaction. This flag is supported by the DB->del, DB->open, DB->put, DB->truncate,DB_ENV->remove, and DB_ENV->rename methods. [#4257]

The DB_EXCL DB->open method flag has been enhanced to work on subdatabases. [#4257]

Fix a bug in which a DB->put(DB_APPEND) could result in leaked memory or a corruption in the returned record number. [#5002]

Fix a bug in the database salvage code that could leave pages pinned in the cache. [#5037]

Add a flag to the DB->verify method to output salvaged key/data pairs in printable characters. [#5037]

Fix a bug in which DB->verify() might continue and report extraneous database corruption after a fatal error. [#5131]

Fix a bug where calling the DB->stat method before the DB->open method could drop core. [#5190]

Fix a bug in which a DB->get, DBcursor->c_get, or DBcursor->c_pget on a secondary index, in the Concurrent Data Store product, could result in a deadlock. [#5192]

Fix a bug in which DB->verify() could correctly report errors but still return success. [#5297]

Add support for the DB->set_cache_priority interface, that allows applications to set the underlying cache priority for their database files. [#5375]

Fix a bug where calling DBcursor->c_pget with a database that is not a secondary index would drop core. [#5391]

Fix a bug where a bug in the DB->truncate method could cause recovery to fail. [#5679]

Fix a bug where DB_GET_RECNO would fail if specified to a secondary index. [#5811]

Fix a bug where building a secondary index for an existing primary database could fail in Concurrent Data Store environments. [#5811]

Fix a bug where the DB->rename method could fail, causing a problem during recovery. [#5893]

Fix a bug in which a DB->get or DB->pget call on a secondary index could fail when done with a handle shared among multiple threads. [#5899]

Fix a bug in which a DB->put operation on a database with off-page duplicates could leak a duplicate cursor, thereby preventing transactions being able to commit. [#5936]

Fix a bug where overflow page reference counts were not properly maintained when databases were truncated. [#6168]

Fix a bug where the bulk get APIs could allocate large amounts of heap memory. [#6439] [#6520]

Btree Access Method Changes:

Fix a bug that prevented loads of sorted data, with duplicates at the end of the tree, from creating compact trees. [#4926]

No longer return a copy of the key if the DB_GET_BOTH or DB_GET_BOTH_RANGE flags are specified. [#4470]

Fix a bug where the fast-search code could hold an unlocked reference to a page, which could lead to recovery failure. [#5518]

Fix a bug where some cursor operations on a database, for which the bt_minkey size had been specified, could fail to use the correct overflow key/data item size. [#6183]

Fix a bug where the recovery of an aborted transaction that did a reverse Btree split might leave a page in an inconsistent state. [#6393]

Hash Access Method Changes:

Fix bugs that could cause hash recovery to drop core. [#4978]

Use access method flags instead of interface flags to check for readonly access to a hash database with an application-specified hash function. [#5121]

Fix a bug where a hash database allocation of a new set of buckets may be improperly recovered by catastrophic recovery if the transaction is split across log files and the beginning segment of the transaction is not included in the set of logs to be recovered. [#5942]

Fix a bug where aborting particular hash allocations could lead to a database on which the verifier would loop infinitely. [#5966]

Fix a bug where a memory allocation failure could result in a system hang. [#5988]

Remove nelem from the Hash access method statistics (the value was incorrect once items had been added or removed from the database). [#6101]

Fix a bug where a page allocated by an aborted transaction might not be placed on the free list by recovery, if the file holding the page was created as part of recovery, and a later page was part of a hash bucket allocation. [#6184]

Fix a bug where allocated pages could be improperly recovered on systems that require explicit zero-ing of filesystem pages. [#6534]

Queue Access Method Changes:

No longer return a copy of the key if the DB_SET_RANGE flag is specified. [#4470]

Fix a bug where DBcursor->c_get (with DB_MULTIPLE or DB_MULTIPLE_KEY specified) could fail on a Queue database if the record numbers had wrapped. [#6397]

Recno Access Method Changes:

No longer return a copy of the key if the DB_GET_BOTH or DB_GET_BOTH_RANGE flags are specified. [#4470]

Fix a bug in the DbEnv destructor that could cause memory corruption when an environment was destroyed without closing first. [#6342]

Change DbEnv and Db destructor behavior to close the handle if it was not already closed. [#6342]

Java-specific API Changes:

Added check for system property "sleepycat.Berkeley DB.libfile" that can be used to specify a complete pathname for the JNI shared library. This is needed as a workaround on Mac OS X, where libtool cannot currently create a library with a .jnilib extension which is what the current JDK expects by default. [#5664]

Fixed handling of JVM out of memory conditions, when some JNI methods return NULL. When the JVM runs out of memory, calls should consistently fail with OutOfMemoryErrors. [#5995]

Added Dbt.get_object and Dbt.set_object convenience routines to the Java API to make using serialization easier. [#6113]

Fixed a bug that prevented Java's Db.set_feedback from working, fixed document for Java's Db.set_feedback, some callback methods were misnamed. [#6137]

Fix a NullPointerException in Db.finalize() if the database had been closed. [#6504]

Marked DbEnv constructor with "throws DbException". [#6342]

Tcl-specific API Changes:

None.

RPC-specific Client/Server Changes:

Fix a bug where Db and DbEnv handles were not thread-safe. [#6102]

Replication Changes:

A large number of replication bugs were fixed in this release. The replication support is now believed to be production quality.

Add the DB_ENV->set_rep_limit interface, allowing applications to limit the data sent in response to a single DB_ENV->rep_process_message call. [#5999]

XA Resource Manager Changes:

Added support for multi-threaded XA. Environments can now have multiple XA transactions active. db_env_xa_attach() can be used to get a DB_TXN that corresponds to the XA transaction in the current thread. [#5049]

Added a com.sleepycat.Berkeley DB.xa package that implements J2EE support for XA. This includes new DbXAResource, DbXid classes that implement the XAResource and Xid interfaces. [#5049]

Fix a bug where aborting a prepared transaction after recovery may fail. [#6383]

Fix a bug where recovery might fail if a prepared transaction had previously extended the size of a file and then was aborted. [#6387]

Fix a bug where if the commit of a prepared transaction fails the transaction would be aborted. [#6389]

Locking Subsystem Changes:

Fix a bug where lock counts were incorrect if a lock request returned DB_LOCK_NOTGRANTED or an error occurred. [#4923]

Fix a bug where lock downgrades were counted as releases, so the lock release statistics could be wrong. [#5762]

Fix a bug where the lock and transaction timeout values could not be reset by threads of control joining Berkeley DB database environments. [#5996]

Fix a bug where applications using lock and/or transaction timeouts could hit a race condition that would lead to a segmentation fault. [#6061]

Logging Subsystem Changes:

DB_ENV->log_register and DB_ENV->log_unregister have been removed from the interface. [#0046]

Fix a bug where creating a database environment with a non-existent logging directory could drop core. [#5833]

Transaction Subsystem Changes:

Go back only one checkpoint, not two, when performing normal recovery. [#4284]

Fix a bug where an abort of a transaction could fail if there was no disk space for the log. [#5740]

Fix a bug where the checkpoint log-sequence-number could reference a non-existent log record. [#5789]

Fix a bug where subtransactions which allocated pages from the filesystem and subsequently aborted could cause other pages allocated by sibling transactions to not be freed if the parent transaction then aborted. [#5903]

Fix a bug where transactions doing multiple updates to a queue database which spanned a checkpoint could be improperly handled by recovery. [#5898]

Utility Changes:

Fix a bug where the -p option could not be specified with the -R or -r options. [#5037]

The utilities were modified to correctly size their private caches in order to handle databases with large page sizes. [#5055]

Fix a bug in which utilities run with the -N option would fail to ignore the environment's panic flag. [#5082]