summaryrefslogtreecommitdiff
path: root/cpp/src/Freeze/ConnectionI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Freeze/ConnectionI.cpp')
-rw-r--r--cpp/src/Freeze/ConnectionI.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/cpp/src/Freeze/ConnectionI.cpp b/cpp/src/Freeze/ConnectionI.cpp
index 66a1e8ba0f7..dae584e3bbd 100644
--- a/cpp/src/Freeze/ConnectionI.cpp
+++ b/cpp/src/Freeze/ConnectionI.cpp
@@ -46,7 +46,7 @@ Freeze::ConnectionI::close()
{
try
{
- _transaction->rollback();
+ _transaction->rollbackInternal(true);
}
catch(const DatabaseException&)
{
@@ -77,6 +77,19 @@ Freeze::ConnectionI::getName() const
return _envName;
}
+//
+// External refcount operations, from code holding a Connection[I]Ptr
+//
+void
+Freeze::ConnectionI::__decRef()
+{
+ if(__getRef() == 2 && _transaction && _transaction->__getRef() == 1)
+ {
+ close();
+ }
+ Shared::__decRef();
+}
+
Freeze::ConnectionI::~ConnectionI()
{
close();