summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2012-08-13 15:06:26 -0400
committerBernard Normier <bernard@zeroc.com>2012-08-13 15:06:26 -0400
commitdc3edd400554edca4abb6fe73723036ed23b49d5 (patch)
tree1e38cfcb8be68e8aece9e3e661c91bf974578c67 /cpp
parentc++11 minor method renaming (diff)
downloadice-dc3edd400554edca4abb6fe73723036ed23b49d5.tar.bz2
ice-dc3edd400554edca4abb6fe73723036ed23b49d5.tar.xz
ice-dc3edd400554edca4abb6fe73723036ed23b49d5.zip
Fixed bug #ICE-4848: transactional evictor bug when receiving operation that does not exist. Added test.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/Freeze/TransactionalEvictorI.cpp8
-rw-r--r--cpp/test/Freeze/evictor/Client.cpp13
2 files changed, 19 insertions, 2 deletions
diff --git a/cpp/src/Freeze/TransactionalEvictorI.cpp b/cpp/src/Freeze/TransactionalEvictorI.cpp
index 27cae3e8282..5d984a5cf4f 100644
--- a/cpp/src/Freeze/TransactionalEvictorI.cpp
+++ b/cpp/src/Freeze/TransactionalEvictorI.cpp
@@ -422,7 +422,12 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
assert(sample != 0);
int operationAttributes = sample->ice_operationAttributes(current.operation);
-
+
+ if(operationAttributes < 0)
+ {
+ throw OperationNotExistException(__FILE__, __LINE__);
+ }
+
bool readOnly = (operationAttributes & 0x1) == 0;
int txMode = (operationAttributes & 0x6) >> 1;
@@ -467,6 +472,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
default:
{
assert(0);
+ throw OperationNotExistException(__FILE__, __LINE__);
}
}
diff --git a/cpp/test/Freeze/evictor/Client.cpp b/cpp/test/Freeze/evictor/Client.cpp
index f397f368cc3..433636aad25 100644
--- a/cpp/test/Freeze/evictor/Client.cpp
+++ b/cpp/test/Freeze/evictor/Client.cpp
@@ -608,7 +608,18 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator, bool trans
{
}
-
+ //
+ // Call an operation that does not exist on the servant
+ //
+ try
+ {
+ int balance = Test::AccountPrx::uncheckedCast(servants[0])->getBalance();
+ test(false);
+ }
+ catch(const Ice::OperationNotExistException&)
+ {
+ }
+
//
// Remove all facets
//