summaryrefslogtreecommitdiff
path: root/cpp/src/Freeze/ConnectionI.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-11-07 14:45:01 -0500
committerBernard Normier <bernard@zeroc.com>2007-11-07 14:45:01 -0500
commit302e8096f25c85c6a6fc3fb5c3ca04736c5db410 (patch)
tree234b54164cd88fd2002972c0f18767f9049e5457 /cpp/src/Freeze/ConnectionI.cpp
parent- Fixing bug 2522 for Python. This involved adding the C++ class (diff)
downloadice-302e8096f25c85c6a6fc3fb5c3ca04736c5db410.tar.bz2
ice-302e8096f25c85c6a6fc3fb5c3ca04736c5db410.tar.xz
ice-302e8096f25c85c6a6fc3fb5c3ca04736c5db410.zip
Fixed bug #819 (C++)
Diffstat (limited to 'cpp/src/Freeze/ConnectionI.cpp')
-rw-r--r--cpp/src/Freeze/ConnectionI.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/cpp/src/Freeze/ConnectionI.cpp b/cpp/src/Freeze/ConnectionI.cpp
index 7bd9a114f13..824fc167c9c 100644
--- a/cpp/src/Freeze/ConnectionI.cpp
+++ b/cpp/src/Freeze/ConnectionI.cpp
@@ -40,6 +40,39 @@ Freeze::ConnectionI::currentTransaction() const
}
void
+Freeze::ConnectionI::removeMapIndex(const string& mapName, const string& indexName)
+{
+ if(_dbEnv == 0)
+ {
+ throw DatabaseException(__FILE__, __LINE__, "Closed connection");
+ }
+
+ string filename = mapName + "." + indexName;
+
+ DbTxn* txn = dbTxn();
+ try
+ {
+ _dbEnv->getEnv()->dbremove(txn, filename.c_str(), 0, txn != 0 ? 0 : DB_AUTO_COMMIT);
+ }
+ catch(const DbDeadlockException& dx)
+ {
+ throw DeadlockException(__FILE__, __LINE__, dx.what());
+ }
+ catch(const DbException& dx)
+ {
+ if(dx.get_errno() == ENOENT)
+ {
+ throw IndexNotFoundException(__FILE__, __LINE__, mapName, indexName);
+ }
+ else
+ {
+ throw DatabaseException(__FILE__, __LINE__, dx.what());
+ }
+ }
+}
+
+
+void
Freeze::ConnectionI::close()
{
if(_transaction)