summaryrefslogtreecommitdiff
path: root/java/src/Ice/ConnectionI.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/Ice/ConnectionI.java')
-rw-r--r--java/src/Ice/ConnectionI.java39
1 files changed, 28 insertions, 11 deletions
diff --git a/java/src/Ice/ConnectionI.java b/java/src/Ice/ConnectionI.java
index 3983c3a183e..5d985429f03 100644
--- a/java/src/Ice/ConnectionI.java
+++ b/java/src/Ice/ConnectionI.java
@@ -644,27 +644,43 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne
_batchStream.swap(os);
//
- // _batchStream now belongs to the caller, until
- // finishBatchRequest() is called.
+ // The batch stream now belongs to the caller, until
+ // finishBatchRequest() or abortBatchRequest() is called.
//
}
public synchronized void
finishBatchRequest(IceInternal.BasicStream os)
{
- if(_exception != null)
- {
- throw _exception;
- }
+ //
+ // Get the batch stream back and increment the number of
+ // requests in the batch.
+ //
+ _batchStream.swap(os);
+ ++_batchRequestNum;
- assert(_state > StateNotValidated);
- assert(_state < StateClosing);
+ //
+ // Notify about the batch stream not being in use anymore.
+ //
+ assert(_batchStreamInUse);
+ _batchStreamInUse = false;
+ notifyAll();
+ }
- _batchStream.swap(os); // Get the batch stream back.
- ++_batchRequestNum; // Increment the number of requests in the batch.
+ public synchronized void
+ abortBatchRequest()
+ {
+ //
+ // Destroy and reset the batch stream and batch count. We
+ // cannot safe old requests in the batch stream, as they might
+ // be corrupted due to incomplete marshaling.
+ //
+ _batchStream.destroy();
+ _batchStream = new IceInternal.BasicStream(_instance);
+ _batchRequestNum = 0;
//
- // Give the ConnectionI back.
+ // Notify about the batch stream not being in use anymore.
//
assert(_batchStreamInUse);
_batchStreamInUse = false;
@@ -1565,6 +1581,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne
registerWithPool();
unregisterWithPool();
}
+
break;
}
}