From d3578a4742a4d46d9ee38aa37e18f5483759278c Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Mon, 3 Oct 2005 16:57:34 +0000 Subject: Refactored code to work-around DB 4.3's DB_BUFFER_SMALL bug --- cpp/src/Freeze/Util.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'cpp/src/Freeze/Util.h') diff --git a/cpp/src/Freeze/Util.h b/cpp/src/Freeze/Util.h index caaf24bf229..1cef571bba1 100644 --- a/cpp/src/Freeze/Util.h +++ b/cpp/src/Freeze/Util.h @@ -48,11 +48,24 @@ initializeOutDbt(std::vector& v, Dbt& dbt) dbt.set_flags(DB_DBT_USERMEM); } + +// +// Handles a Berkeley DB DbException by resizing the +// given key/value/dbt (when the exception's errno is +// DB_SMALL_BUFFER) or by throwing a +// Freeze::DatabaseException +// + +void +handleDbException(const DbException&, const char*, int); + void -handleMemoryException(const DbMemoryException&, Key&, Dbt&); +handleDbException(const DbException&, Key&, Dbt&, + const char*, int); void -handleMemoryException(const DbMemoryException&, Key&, Dbt&, Value&, Dbt&); +handleDbException(const DbException&, Key&, Dbt&, Value&, Dbt&, + const char*, int); } -- cgit v1.2.3