|
17 | 17 | import com.genexus.util.NameValuePair;
|
18 | 18 | import json.org.json.JSONException;
|
19 | 19 | import json.org.json.JSONObject;
|
| 20 | +import reactor.core.Disposable; |
20 | 21 | import reactor.core.publisher.Mono;
|
21 | 22 |
|
22 | 23 | import java.io.InputStream;
|
@@ -45,7 +46,7 @@ public class CosmosDBPreparedStatement extends ServicePreparedStatement
|
45 | 46 | super(con, parms, gxCon);
|
46 | 47 | this.query = query;
|
47 | 48 | this.cursor = cursor;
|
48 |
| - getCointainer(query.tableName); |
| 49 | + getContainer(query.tableName); |
49 | 50 | }
|
50 | 51 | @Override
|
51 | 52 | public ResultSet executeQuery() throws SQLException
|
@@ -135,7 +136,7 @@ private int _executeQuery(CosmosDBResultSet resultSet) throws Exception {
|
135 | 136 | CosmosAsyncDatabase getDatabase() throws SQLException {
|
136 | 137 | return ((CosmosDBConnection)getConnection()).cosmosDatabase;
|
137 | 138 | }
|
138 |
| - private void getCointainer(String containerName) throws SQLException { |
| 139 | + private void getContainer(String containerName) throws SQLException { |
139 | 140 | container = getDatabase().getContainer(containerName);
|
140 | 141 | }
|
141 | 142 |
|
@@ -223,8 +224,9 @@ private int[] deleteDocument(String idValue, Object partitionKey) throws Excepti
|
223 | 224 | statusCode[0] = 404;
|
224 | 225 | latch.countDown();
|
225 | 226 | });
|
226 |
| - cosmosItemResponseMono.subscribe(); |
| 227 | + Disposable d = cosmosItemResponseMono.subscribe(); |
227 | 228 | latch.await();
|
| 229 | + d.dispose(); |
228 | 230 | return statusCode;
|
229 | 231 | }
|
230 | 232 | else
|
@@ -259,9 +261,9 @@ private int[] createDocument(JSONObject jsonObject, Object partitionKey) throws
|
259 | 261 | latch.countDown();
|
260 | 262 | });
|
261 | 263 |
|
262 |
| - cosmosItemResponseMono.subscribe(); |
| 264 | + Disposable d = cosmosItemResponseMono.subscribe(); |
263 | 265 | latch.await();
|
264 |
| - |
| 266 | + d.dispose(); |
265 | 267 | return statusCode;
|
266 | 268 | } else {
|
267 | 269 | throw new Exception("CosmosDB Insert Execution failed. Invalid json payload.");
|
@@ -296,8 +298,9 @@ private int[] replaceDocument(JSONObject jsonObject, String idValue , Object par
|
296 | 298 | latch.countDown();
|
297 | 299 | });
|
298 | 300 |
|
299 |
| - cosmosItemResponseMono.subscribe(); |
| 301 | + Disposable d = cosmosItemResponseMono.subscribe(); |
300 | 302 | latch.await();
|
| 303 | + d.dispose(); |
301 | 304 | return statusCode;
|
302 | 305 | }
|
303 | 306 | else {
|
|
0 commit comments