summaryrefslogtreecommitdiff
path: root/cpp/src/Freeze/ConnectionI.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2007-09-06 19:03:27 +0800
committerMatthew Newhook <matthew@zeroc.com>2007-09-06 19:03:27 +0800
commit0341410e2f4a5079708e9022e99531ccf3b1708e (patch)
treebdbfcf6c8580e6723ec27d1ea2961c89d2515112 /cpp/src/Freeze/ConnectionI.cpp
parenthttp://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1351 - use monotonic timer... (diff)
downloadice-0341410e2f4a5079708e9022e99531ccf3b1708e.tar.bz2
ice-0341410e2f4a5079708e9022e99531ccf3b1708e.tar.xz
ice-0341410e2f4a5079708e9022e99531ccf3b1708e.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=2233
Squashed commit of the following: commit 9c5b39640659633dfad70341c4e709eeda8d5f8e Author: Matthew Newhook <matthew@zeroc.com> Date: Thu Sep 6 18:13:59 2007 +0800 More fixes. commit 49cade00fee4dfc00fd688ba1ca8bcbf80376b59 Author: Matthew Newhook <matthew@zeroc.com> Date: Thu Sep 6 17:07:36 2007 +0800 removed debug. commit f33af74a2fe64ee2433228133c58afe6278fc5f3 Author: Matthew Newhook <matthew@zeroc.com> Date: Thu Sep 6 17:03:01 2007 +0800 fixes. commit a145684f88b000087a6fe5551bb9018ad03c8307 Author: Matthew Newhook <matthew@zeroc.com> Date: Thu Sep 6 15:25:37 2007 +0800 altered reference counting as suggested in the bug report.
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();