diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/AbstractODataBatchRequest.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/AbstractODataBatchRequest.java index df03f49c4..428dbf59c 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/AbstractODataBatchRequest.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/AbstractODataBatchRequest.java @@ -49,10 +49,6 @@ public abstract class AbstractODataBatchRequest expectedResItems = new ArrayList(); - protected void addExpectedResItem(ODataBatchResponseItem item) { - expectedResItems.add(item); - } - /** * Constructor. * @@ -69,6 +65,10 @@ public abstract class AbstractODataBatchRequest getBody() { return new ODataBatchResponseManager(this, expectedResItems); } + + @Override + public void close() { + for (ODataBatchResponseItem resItem : expectedResItems) { + resItem.close(); + } + super.close(); + } } } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/v4/ODataBatchRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/v4/ODataBatchRequestImpl.java index f7dc70797..52d5194ad 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/v4/ODataBatchRequestImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/v4/ODataBatchRequestImpl.java @@ -124,5 +124,14 @@ public class ODataBatchRequestImpl public Iterator getBody() { return new ODataBatchResponseManager(this, expectedResItems, continueOnError); } + + @Override + public void close() { + for (ODataBatchResponseItem resItem : expectedResItems) { + resItem.close(); + } + super.close(); + } + } }