diff options
author | Bernard Normier <bernard@zeroc.com> | 2005-10-03 16:57:34 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2005-10-03 16:57:34 +0000 |
commit | d3578a4742a4d46d9ee38aa37e18f5483759278c (patch) | |
tree | 790b53f267cb55d8f9993d9338cbbbafec9886af /cpp/src/Freeze/MapI.cpp | |
parent | Fixed bogus dependency on Internal.h in icegridadmin (diff) | |
download | ice-d3578a4742a4d46d9ee38aa37e18f5483759278c.tar.bz2 ice-d3578a4742a4d46d9ee38aa37e18f5483759278c.tar.xz ice-d3578a4742a4d46d9ee38aa37e18f5483759278c.zip |
Refactored code to work-around DB 4.3's DB_BUFFER_SMALL bug
Diffstat (limited to 'cpp/src/Freeze/MapI.cpp')
-rw-r--r-- | cpp/src/Freeze/MapI.cpp | 62 |
1 files changed, 3 insertions, 59 deletions
diff --git a/cpp/src/Freeze/MapI.cpp b/cpp/src/Freeze/MapI.cpp index 0766bc034d0..f9473110012 100644 --- a/cpp/src/Freeze/MapI.cpp +++ b/cpp/src/Freeze/MapI.cpp @@ -299,39 +299,6 @@ Freeze::IteratorHelperI::get(const Key*& key, const Value*& value) const throw DatabaseException(__FILE__, __LINE__); } } - catch(const ::DbMemoryException dx) - { - bool resizing = false; - if(dbKey.get_size() > dbKey.get_ulen()) - { - // - // Let's resize key - // - _key.resize(dbKey.get_size()); - initializeOutDbt(_key, dbKey); - resizing = true; - } - - if(dbValue.get_size() > dbValue.get_ulen()) - { - // - // Let's resize value - // - _value.resize(dbValue.get_size()); - initializeOutDbt(_value, dbValue); - resizing = true; - } - - if(!resizing) - { - // - // Real problem - // - DatabaseException ex(__FILE__, __LINE__); - ex.message = dx.what(); - throw ex; - } - } catch(const ::DbDeadlockException& dx) { if(_tx != 0) @@ -345,9 +312,8 @@ Freeze::IteratorHelperI::get(const Key*& key, const Value*& value) const } catch(const ::DbException& dx) { - DatabaseException ex(__FILE__, __LINE__); - ex.message = dx.what(); - throw ex; + handleDbException(dx, _key, dbKey, _value, dbValue, + __FILE__, __LINE__); } } } @@ -409,26 +375,6 @@ Freeze::IteratorHelperI::get() const throw DatabaseException(__FILE__, __LINE__); } } - catch(const ::DbMemoryException dx) - { - if(dbKey.get_size() > dbKey.get_ulen()) - { - // - // Let's resize key - // - _key.resize(dbKey.get_size()); - initializeOutDbt(_key, dbKey); - } - else - { - // - // Real problem - // - DatabaseException ex(__FILE__, __LINE__); - ex.message = dx.what(); - throw ex; - } - } catch(const ::DbDeadlockException& dx) { if(_tx != 0) @@ -442,9 +388,7 @@ Freeze::IteratorHelperI::get() const } catch(const ::DbException& dx) { - DatabaseException ex(__FILE__, __LINE__); - ex.message = dx.what(); - throw ex; + handleDbException(dx, _key, dbKey, __FILE__, __LINE__); } } } |