diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-07-02 16:20:34 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-07-02 16:20:34 +0200 |
commit | dc83f174fc27154c43f133a2983a90205e05ec37 (patch) | |
tree | 7b8d01980a9fe00a3718e19a89866b47c3c7b06e /java/src/Ice/ConnectionI.java | |
parent | Changed Java and C# mapping to avoid generation of an {{{OperationsNC}}} inte... (diff) | |
download | ice-dc83f174fc27154c43f133a2983a90205e05ec37.tar.bz2 ice-dc83f174fc27154c43f133a2983a90205e05ec37.tar.xz ice-dc83f174fc27154c43f133a2983a90205e05ec37.zip |
Fixed bug 4145 - unexpected exception from batch request
Diffstat (limited to 'java/src/Ice/ConnectionI.java')
-rw-r--r-- | java/src/Ice/ConnectionI.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/java/src/Ice/ConnectionI.java b/java/src/Ice/ConnectionI.java index 7b83d46bf1e..fea7381371e 100644 --- a/java/src/Ice/ConnectionI.java +++ b/java/src/Ice/ConnectionI.java @@ -459,6 +459,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne public synchronized void prepareBatchRequest(IceInternal.BasicStream os) + throws IceInternal.LocalExceptionWrapper { // // Wait if flushing is currently in progress. @@ -476,7 +477,19 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne if(_exception != null) { - throw _exception; + // + // If there were no batch requests queued when the connection failed, we can safely + // retry with a new connection. Otherwise, we must throw to notify the caller that + // some previous batch requests were not sent. + // + if(_batchStream.isEmpty()) + { + throw new IceInternal.LocalExceptionWrapper(_exception, true); + } + else + { + throw _exception; + } } assert(_state > StateNotValidated); |