Skip to content

Commit 3938bd4

Browse files
committed
fix #494 -- close DocumentPage to free up open connections
(cherry picked from commit 7f89112)
1 parent fb06588 commit 3938bd4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/com/marklogic/client/datamovement/ExportListener.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ protected DocumentPage getDocs(QueryBatch batch) {
101101
*/
102102
@Override
103103
public void processEvent(QueryBatch batch) {
104-
try {
105-
DocumentPage docs = getDocs(batch);
104+
try ( DocumentPage docs = getDocs(batch) ) {
106105
while ( docs.hasNext() ) {
107106
for ( Consumer<DocumentRecord> listener : exportListeners ) {
108107
try {

0 commit comments

Comments
 (0)