diff options
author | ZeroC Staff <git@zeroc.com> | 2007-12-12 21:01:52 -0500 |
---|---|---|
committer | ZeroC Staff <git@zeroc.com> | 2007-12-12 21:01:52 -0500 |
commit | 883a047970693d63716aade9bd94f38c75012c7c (patch) | |
tree | 28f414393cc199bd852d618bcaf4702dd380759b /cpp/src/Ice/Proxy.cpp | |
parent | Fixed VC build (diff) | |
parent | Fixed bug 2592 (diff) | |
download | ice-883a047970693d63716aade9bd94f38c75012c7c.tar.bz2 ice-883a047970693d63716aade9bd94f38c75012c7c.tar.xz ice-883a047970693d63716aade9bd94f38c75012c7c.zip |
Merge branch 'master' of bernard@cvs.zeroc.com:/home/git/ice
Diffstat (limited to 'cpp/src/Ice/Proxy.cpp')
-rw-r--r-- | cpp/src/Ice/Proxy.cpp | 53 |
1 files changed, 21 insertions, 32 deletions
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index 845d40ffee5..1191532eda2 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -827,7 +827,8 @@ IceProxy::Ice::Object::ice_getConnection() try { __del = __getDelegate(false); - return __del->__getRequestHandler()->getConnection(true); + return __del->__getRequestHandler()->getConnection(true); // Wait for the connection to be established. + } catch(const LocalException& __ex) { @@ -861,24 +862,20 @@ IceProxy::Ice::Object::ice_getCachedConnection() const void IceProxy::Ice::Object::ice_flushBatchRequests() { - int __cnt; - while(true) + // + // We don't automatically retry if ice_flushBatchRequests fails. Otherwise, if some batch + // requests were queued with the connection, they would be lost without being noticed. + // + Handle< ::IceDelegate::Ice::Object> __del; + int __cnt = -1; // Don't retry. + try { - Handle< ::IceDelegate::Ice::Object> __del; - try - { - __del = __getDelegate(false); - __del->ice_flushBatchRequests(); - return; - } - catch(const LocalExceptionWrapper& __ex) - { - __handleExceptionWrapper(__del, __ex); - } - catch(const LocalException& __ex) - { - __handleException(__del, __ex, __cnt); - } + __del = __getDelegate(false); + __del->ice_flushBatchRequests(); + } + catch(const LocalException& __ex) + { + __handleException(__del, __ex, __cnt); } } @@ -956,6 +953,11 @@ IceProxy::Ice::Object::__handleException(const ::IceInternal::Handle< ::IceDeleg _delegate = 0; } + if(cnt == -1) // Don't retry if the retry count is -1. + { + ex.ice_throw(); + } + ProxyFactoryPtr proxyFactory; try { @@ -967,7 +969,6 @@ IceProxy::Ice::Object::__handleException(const ::IceInternal::Handle< ::IceDeleg // The communicator is already destroyed, so we cannot retry. // ex.ice_throw(); - } proxyFactory->checkRetryAfterException(ex, _reference, cnt); @@ -1315,19 +1316,7 @@ void IceDelegateM::Ice::Object::ice_flushBatchRequests() { BatchOutgoing __og(__handler.get()); - try - { - __og.invoke(); - } - catch(const ::Ice::LocalException& __ex) - { - // - // We never retry flusing the batch requests as the connection batched - // requests were discarded and the caller needs to be notified of the - // failure. - // - throw ::IceInternal::LocalExceptionWrapper(__ex, false); - } + __og.invoke(); } RequestHandlerPtr |