Here is the test case
@test
public void testBulkWritewithTransactions() throws Exception {
int count=1;
Transaction t1 = client.openTransaction();
XMLDocumentManager docMgr = client.newXMLDocumentManager();
HashMap<String,String> map= new HashMap<String,String>();
DocumentWriteSet writeset =docMgr.newWriteSet();
for(int i =0;i<12;i++){
writeset.add(DIRECTORY+"foo"+i+".xml", new DOMHandle(getDocumentContent("This is so foo"+i)));
map.put(DIRECTORY+"foo"+i+".xml", convertXMLDocumentToString(getDocumentContent("This is so foo"+i)));
if(count%BATCH_SIZE == 0){
docMgr.write(writeset,t1);
writeset = docMgr.newWriteSet();
}
count++;
}
if(count%BATCH_SIZE > 0){
docMgr.write(writeset,t1);
}
String uris[] = new String[12];
for(int i =0;i<12;i++){
uris[i]=DIRECTORY+"foo"+i+".xml";
}
// t1.commit();
count=0;
DocumentPage page = docMgr.read(t1,uris);
DOMHandle dh = new DOMHandle();
while(page.hasNext()){
DocumentRecord rec = page.next();
validateRecord(rec,Format.XML);
rec.getContent(dh);
assertEquals("Comparing the content :",map.get(rec.getUri()),convertXMLDocumentToString(dh.get()));
count++;
}
assertEquals("document count", 102,count);
}
I see the following when I enable Http wire logging
[DEBUG] ThreadSafeClientConnManager - Get connection: HttpRoute[{}->http://localhost:8011], timeout = 0
[DEBUG] ConnPoolByRoute - [HttpRoute[{}->http://localhost:8011]] total kept alive: 0, total issued: 0, total allocated: 0 out of 200
[DEBUG] ConnPoolByRoute - No free connections [HttpRoute[{}->http://localhost:8011]][null]
[DEBUG] ConnPoolByRoute - Available capacity: 100 out of 100 [HttpRoute[{}->http://localhost:8011]][null]
[DEBUG] ConnPoolByRoute - Creating new connection [HttpRoute[{}->http://localhost:8011]]
[DEBUG] DefaultClientConnectionOperator - Connecting to localhost/127.0.0.1:8011
[DEBUG] RequestAddCookies - CookieSpec selected: best-match
[DEBUG] RequestAuthCache - Auth cache not set in the context
[DEBUG] DefaultHttpClient - Attempt 1 to execute request
[DEBUG] DefaultClientConnection - Sending request: POST /v1/transactions HTTP/1.1
[DEBUG] wire - >> "POST /v1/transactions HTTP/1.1[\r][\n]"
[DEBUG] wire - >> "Content-Length: 0[\r][\n]"
[DEBUG] wire - >> "Host: localhost:8011[\r][\n]"
[DEBUG] wire - >> "Connection: Keep-Alive[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] headers - >> POST /v1/transactions HTTP/1.1
[DEBUG] headers - >> Content-Length: 0
[DEBUG] headers - >> Host: localhost:8011
[DEBUG] headers - >> Connection: Keep-Alive
[DEBUG] wire - << "HTTP/1.1 401 Unauthorized[\r][\n]"
[DEBUG] wire - << "WWW-Authenticate: Digest realm="public", qop="auth", nonce="50d5b60b853b0bd2cd594ed63a6df144", opaque="a356e486d94715d7"[\r][\n]"
[DEBUG] wire - << "Content-type: application/json[\r][\n]"
[DEBUG] wire - << "Server: MarkLogic[\r][\n]"
[DEBUG] wire - << "Content-Length: 103[\r][\n]"
[DEBUG] wire - << "Connection: Keep-Alive[\r][\n]"
[DEBUG] wire - << "Keep-Alive: timeout=5[\r][\n]"
[DEBUG] wire - << "[\r][\n]"
[DEBUG] DefaultClientConnection - Receiving response: HTTP/1.1 401 Unauthorized
[DEBUG] headers - << HTTP/1.1 401 Unauthorized
[DEBUG] headers - << WWW-Authenticate: Digest realm="public", qop="auth", nonce="50d5b60b853b0bd2cd594ed63a6df144", opaque="a356e486d94715d7"
[DEBUG] headers - << Content-type: application/json
[DEBUG] headers - << Server: MarkLogic
[DEBUG] headers - << Content-Length: 103
[DEBUG] headers - << Connection: Keep-Alive
[DEBUG] headers - << Keep-Alive: timeout=5
[DEBUG] DefaultHttpClient - Connection can be kept alive for 5000 MILLISECONDS
[DEBUG] DefaultHttpClient - Target requested authentication
[DEBUG] DefaultTargetAuthenticationHandler - Authentication schemes in the order of preference: [negotiate, NTLM, Digest, Basic]
[DEBUG] DefaultTargetAuthenticationHandler - Challenge for negotiate authentication scheme not available
[DEBUG] DefaultTargetAuthenticationHandler - Challenge for NTLM authentication scheme not available
[DEBUG] DefaultTargetAuthenticationHandler - Digest authentication scheme selected
[DEBUG] DefaultHttpClient - Authorization challenge processed
[DEBUG] DefaultHttpClient - Authentication scope: DIGEST 'public'@localhost:8011
[DEBUG] DefaultHttpClient - Credentials not found
[DEBUG] wire - << "{"error":{"status-code":"401", "status":"Failed Auth", "message-code":"", "message":"Unauthenticated"}}"
[DEBUG] ThreadSafeClientConnManager - Released connection is reusable.
[DEBUG] ConnPoolByRoute - Releasing connection [HttpRoute[{}->http://localhost:8011]][null]
[DEBUG] ConnPoolByRoute - Pooling connection [HttpRoute[{}->http://localhost:8011]][null]; keep alive for 5000 MILLISECONDS
[DEBUG] ConnPoolByRoute - Notifying no-one, there are no waiting threads
[DEBUG] ThreadSafeClientConnManager - Get connection: HttpRoute[{}->http://localhost:8011], timeout = 0
[DEBUG] ConnPoolByRoute - [HttpRoute[{}->http://localhost:8011]] total kept alive: 1, total issued: 0, total allocated: 1 out of 200
[DEBUG] ConnPoolByRoute - Getting free connection [HttpRoute[{}->http://localhost:8011]][null]
[DEBUG] DefaultHttpClient - Stale connection check
[DEBUG] RequestAddCookies - CookieSpec selected: best-match
[DEBUG] RequestAuthCache - Auth cache not set in the context
[DEBUG] DefaultHttpClient - Attempt 1 to execute request
[DEBUG] DefaultClientConnection - Sending request: POST /v1/transactions HTTP/1.1
[DEBUG] wire - >> "POST /v1/transactions HTTP/1.1[\r][\n]"
[DEBUG] wire - >> "Authorization: Digest username="usr1",realm="public",nonce="50d5b60b853b0bd2cd594ed63a6df144",opaque="a356e486d94715d7",qop=auth,uri="/v1/transactions",cnonce="a65dfbd6",nc=00000001,response="506dc2990d3be9b67c374580cde31d4b"[\r][\n]"
[DEBUG] wire - >> "Content-Length: 0[\r][\n]"
[DEBUG] wire - >> "Host: localhost:8011[\r][\n]"
[DEBUG] wire - >> "Connection: Keep-Alive[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] headers - >> POST /v1/transactions HTTP/1.1
[DEBUG] headers - >> Authorization: Digest username="usr1",realm="public",nonce="50d5b60b853b0bd2cd594ed63a6df144",opaque="a356e486d94715d7",qop=auth,uri="/v1/transactions",cnonce="a65dfbd6",nc=00000001,response="506dc2990d3be9b67c374580cde31d4b"
[DEBUG] headers - >> Content-Length: 0
[DEBUG] headers - >> Host: localhost:8011
[DEBUG] headers - >> Connection: Keep-Alive
[DEBUG] wire - << "HTTP/1.1 303 See Created Transaction[\r][\n]"
[DEBUG] wire - << "Set-Cookie: HostId=18106243054103630114[\r][\n]"
[DEBUG] wire - << "Location: /v1/transactions/18106243054103630114_15536520426208774143[\r][\n]"
[DEBUG] wire - << "Server: MarkLogic[\r][\n]"
[DEBUG] wire - << "Content-Length: 0[\r][\n]"
[DEBUG] wire - << "Connection: Keep-Alive[\r][\n]"
[DEBUG] wire - << "Keep-Alive: timeout=5[\r][\n]"
[DEBUG] wire - << "[\r][\n]"
[DEBUG] DefaultClientConnection - Receiving response: HTTP/1.1 303 See Created Transaction
[DEBUG] headers - << HTTP/1.1 303 See Created Transaction
[DEBUG] headers - << Set-Cookie: HostId=18106243054103630114
[DEBUG] headers - << Location: /v1/transactions/18106243054103630114_15536520426208774143
[DEBUG] headers - << Server: MarkLogic
[DEBUG] headers - << Content-Length: 0
[DEBUG] headers - << Connection: Keep-Alive
[DEBUG] headers - << Keep-Alive: timeout=5
[DEBUG] ResponseProcessCookies - Cookie accepted: "[version: 0][name: HostId][value: 18106243054103630114][domain: localhost][path: /v1][expiry: null]".
[DEBUG] DefaultHttpClient - Connection can be kept alive for 5000 MILLISECONDS
[DEBUG] ThreadSafeClientConnManager - Released connection is reusable.
[DEBUG] ConnPoolByRoute - Releasing connection [HttpRoute[{}->http://localhost:8011]][null]
[DEBUG] ConnPoolByRoute - Pooling connection [HttpRoute[{}->http://localhost:8011]][null]; keep alive for 5000 MILLISECONDS
[DEBUG] ConnPoolByRoute - Notifying no-one, there are no waiting threads
[DEBUG] ThreadSafeClientConnManager - Get connection: HttpRoute[{}->http://localhost:8011], timeout = 0
[DEBUG] ConnPoolByRoute - [HttpRoute[{}->http://localhost:8011]] total kept alive: 1, total issued: 0, total allocated: 1 out of 200
[DEBUG] ConnPoolByRoute - Getting free connection [HttpRoute[{}->http://localhost:8011]][null]
[DEBUG] DefaultHttpClient - Stale connection check
[DEBUG] RequestAddCookies - CookieSpec selected: best-match
[DEBUG] RequestAddCookies - Cookie [version: 0][name: HostId][value: 18106243054103630114][domain: localhost][path: /v1][expiry: null] match [localhost:8011/v1/documents]
[DEBUG] RequestAuthCache - Auth cache not set in the context
[DEBUG] DefaultHttpClient - Attempt 1 to execute request
[DEBUG] DefaultClientConnection - Sending request: POST /v1/documents?txid=18106243054103630114_15536520426208774143 HTTP/1.1
[DEBUG] wire - >> "POST /v1/documents?txid=18106243054103630114_15536520426208774143 HTTP/1.1[\r][\n]"
[DEBUG] wire - >> "Content-Type: multipart/mixed; boundary=Boundary_1_1078351181_1406165984811[\r][\n]"
[DEBUG] wire - >> "Authorization: Digest username="usr1",realm="public",nonce="50d5b60b853b0bd2cd594ed63a6df144",opaque="a356e486d94715d7",qop=auth,uri="/v1/documents",cnonce="913ca9a3",nc=00000002,response="7a88727f8b4aa140395b4f39d4ee7e4a"[\r][\n]"
[DEBUG] wire - >> "Transfer-Encoding: chunked[\r][\n]"
[DEBUG] wire - >> "Host: localhost:8011[\r][\n]"
[DEBUG] wire - >> "Connection: Keep-Alive[\r][\n]"
[DEBUG] wire - >> "Cookie: HostId=18106243054103630114[\r][\n]"
[DEBUG] wire - >> "Cookie2: $Version=1[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] headers - >> POST /v1/documents?txid=18106243054103630114_15536520426208774143 HTTP/1.1
[DEBUG] headers - >> Content-Type: multipart/mixed; boundary=Boundary_1_1078351181_1406165984811
[DEBUG] headers - >> Authorization: Digest username="usr1",realm="public",nonce="50d5b60b853b0bd2cd594ed63a6df144",opaque="a356e486d94715d7",qop=auth,uri="/v1/documents",cnonce="913ca9a3",nc=00000002,response="7a88727f8b4aa140395b4f39d4ee7e4a"
[DEBUG] headers - >> Transfer-Encoding: chunked
[DEBUG] headers - >> Host: localhost:8011
[DEBUG] headers - >> Connection: Keep-Alive
[DEBUG] headers - >> Cookie: HostId=18106243054103630114
[DEBUG] headers - >> Cookie2: $Version=1
[DEBUG] wire - >> "8e[\r][\n]"
[DEBUG] wire - >> "--Boundary_1_1078351181_1406165984811[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo0.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "41[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo0"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "90[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_1_1078351181_1406165984811[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo1.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "41[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo1"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "90[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_1_1078351181_1406165984811[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo2.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "41[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo2"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "90[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_1_1078351181_1406165984811[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo3.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "41[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo3"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "90[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_1_1078351181_1406165984811[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo4.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "41[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo4"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "90[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_1_1078351181_1406165984811[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo5.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "41[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo5"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "90[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_1_1078351181_1406165984811[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo6.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "41[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo6"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "90[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_1_1078351181_1406165984811[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo7.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "41[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo7"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "90[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_1_1078351181_1406165984811[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo8.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "41[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo8"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "90[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_1_1078351181_1406165984811[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo9.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "41[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo9"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "2b[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_1_1078351181_1406165984811--[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "0[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - << "HTTP/1.1 200 Bulk Change Written[\r][\n]"
[DEBUG] wire - << "Set-Cookie: HostId=18106243054103630114[\r][\n]"
[DEBUG] wire - << "vnd.marklogic.document-format: xml[\r][\n]"
[DEBUG] wire - << "Content-type: application/xml; charset=utf-8[\r][\n]"
[DEBUG] wire - << "Server: MarkLogic[\r][\n]"
[DEBUG] wire - << "Content-Length: 2087[\r][\n]"
[DEBUG] wire - << "Connection: Keep-Alive[\r][\n]"
[DEBUG] wire - << "Keep-Alive: timeout=5[\r][\n]"
[DEBUG] wire - << "[\r][\n]"
[DEBUG] DefaultClientConnection - Receiving response: HTTP/1.1 200 Bulk Change Written
[DEBUG] headers - << HTTP/1.1 200 Bulk Change Written
[DEBUG] headers - << Set-Cookie: HostId=18106243054103630114
[DEBUG] headers - << vnd.marklogic.document-format: xml
[DEBUG] headers - << Content-type: application/xml; charset=utf-8
[DEBUG] headers - << Server: MarkLogic
[DEBUG] headers - << Content-Length: 2087
[DEBUG] headers - << Connection: Keep-Alive
[DEBUG] headers - << Keep-Alive: timeout=5
[DEBUG] ResponseProcessCookies - Cookie accepted: "[version: 0][name: HostId][value: 18106243054103630114][domain: localhost][path: /v1][expiry: null]".
[DEBUG] DefaultHttpClient - Connection can be kept alive for 5000 MILLISECONDS
[DEBUG] wire - << "<rapi:documents xmlns:rapi="http://marklogic.com/rest-api">rapi:documentrapi:uri/bulkTransacton/foo0.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:documentrapi:documentrapi:uri/bulkTransacton/foo1.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:documentrapi:documentrapi:uri/bulkTransacton/foo2.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:documentrapi:documentrapi:uri/bulkTransacton/foo3.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:documentrapi:documentrapi:uri/bulkTransacton/foo4.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:documentrapi:documentrapi:uri/bulkTransacton/foo5.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:documentrapi:documentrapi:uri/bulkTransacton/foo6.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:documentrapi:documentrapi:uri/bulkTransacton/foo7.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:documentrapi:documentrapi:uri/bulkTransacton/foo8.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:documentrapi:documentrapi:uri/bulkTransacton/foo9.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:document/rapi:documents[\n]"
[DEBUG] ThreadSafeClientConnManager - Released connection is reusable.
[DEBUG] ConnPoolByRoute - Releasing connection [HttpRoute[{}->http://localhost:8011]][null]
[DEBUG] ConnPoolByRoute - Pooling connection [HttpRoute[{}->http://localhost:8011]][null]; keep alive for 5000 MILLISECONDS
[DEBUG] ConnPoolByRoute - Notifying no-one, there are no waiting threads
[DEBUG] ThreadSafeClientConnManager - Get connection: HttpRoute[{}->http://localhost:8011], timeout = 0
[DEBUG] ConnPoolByRoute - [HttpRoute[{}->http://localhost:8011]] total kept alive: 1, total issued: 0, total allocated: 1 out of 200
[DEBUG] ConnPoolByRoute - Getting free connection [HttpRoute[{}->http://localhost:8011]][null]
[DEBUG] DefaultHttpClient - Stale connection check
[DEBUG] RequestAddCookies - CookieSpec selected: best-match
[DEBUG] RequestAddCookies - Cookie [version: 0][name: HostId][value: 18106243054103630114][domain: localhost][path: /v1][expiry: null] match [localhost:8011/v1/documents]
[DEBUG] RequestAuthCache - Auth cache not set in the context
[DEBUG] DefaultHttpClient - Attempt 1 to execute request
[DEBUG] DefaultClientConnection - Sending request: POST /v1/documents?txid=18106243054103630114_15536520426208774143 HTTP/1.1
[DEBUG] wire - >> "POST /v1/documents?txid=18106243054103630114_15536520426208774143 HTTP/1.1[\r][\n]"
[DEBUG] wire - >> "Content-Type: multipart/mixed; boundary=Boundary_2_232517457_1406165986549[\r][\n]"
[DEBUG] wire - >> "Authorization: Digest username="usr1",realm="public",nonce="50d5b60b853b0bd2cd594ed63a6df144",opaque="a356e486d94715d7",qop=auth,uri="/v1/documents",cnonce="ddbf4f09",nc=00000003,response="897d3c3cf7f277d8bd6a80f4f3eace8b"[\r][\n]"
[DEBUG] wire - >> "Transfer-Encoding: chunked[\r][\n]"
[DEBUG] wire - >> "Host: localhost:8011[\r][\n]"
[DEBUG] wire - >> "Connection: Keep-Alive[\r][\n]"
[DEBUG] wire - >> "Cookie: HostId=18106243054103630114[\r][\n]"
[DEBUG] wire - >> "Cookie2: $Version=1[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] headers - >> POST /v1/documents?txid=18106243054103630114_15536520426208774143 HTTP/1.1
[DEBUG] headers - >> Content-Type: multipart/mixed; boundary=Boundary_2_232517457_1406165986549
[DEBUG] headers - >> Authorization: Digest username="usr1",realm="public",nonce="50d5b60b853b0bd2cd594ed63a6df144",opaque="a356e486d94715d7",qop=auth,uri="/v1/documents",cnonce="ddbf4f09",nc=00000003,response="897d3c3cf7f277d8bd6a80f4f3eace8b"
[DEBUG] headers - >> Transfer-Encoding: chunked
[DEBUG] headers - >> Host: localhost:8011
[DEBUG] headers - >> Connection: Keep-Alive
[DEBUG] headers - >> Cookie: HostId=18106243054103630114
[DEBUG] headers - >> Cookie2: $Version=1
[DEBUG] wire - >> "8e[\r][\n]"
[DEBUG] wire - >> "--Boundary_2_232517457_1406165986549[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo10.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "42[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo10"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "90[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_2_232517457_1406165986549[\r][\n]"
[DEBUG] wire - >> "Content-Disposition: attachment; filename="/bulkTransacton/foo11.xml"[\r][\n]"
[DEBUG] wire - >> "Content-Type: application/xml[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "42[\r][\n]"
[DEBUG] wire - >> "[\n]"
[DEBUG] wire - >> "This is so foo11"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "2a[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "--Boundary_2_232517457_1406165986549--[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - >> "0[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] wire - << "HTTP/1.1 200 Bulk Change Written[\r][\n]"
[DEBUG] wire - << "Set-Cookie: HostId=18106243054103630114[\r][\n]"
[DEBUG] wire - << "vnd.marklogic.document-format: xml[\r][\n]"
[DEBUG] wire - << "Content-type: application/xml; charset=utf-8[\r][\n]"
[DEBUG] wire - << "Server: MarkLogic[\r][\n]"
[DEBUG] wire - << "Content-Length: 481[\r][\n]"
[DEBUG] wire - << "Connection: Keep-Alive[\r][\n]"
[DEBUG] wire - << "Keep-Alive: timeout=5[\r][\n]"
[DEBUG] wire - << "[\r][\n]"
[DEBUG] DefaultClientConnection - Receiving response: HTTP/1.1 200 Bulk Change Written
[DEBUG] headers - << HTTP/1.1 200 Bulk Change Written
[DEBUG] headers - << Set-Cookie: HostId=18106243054103630114
[DEBUG] headers - << vnd.marklogic.document-format: xml
[DEBUG] headers - << Content-type: application/xml; charset=utf-8
[DEBUG] headers - << Server: MarkLogic
[DEBUG] headers - << Content-Length: 481
[DEBUG] headers - << Connection: Keep-Alive
[DEBUG] headers - << Keep-Alive: timeout=5
[DEBUG] ResponseProcessCookies - Cookie accepted: "[version: 0][name: HostId][value: 18106243054103630114][domain: localhost][path: /v1][expiry: null]".
[DEBUG] DefaultHttpClient - Connection can be kept alive for 5000 MILLISECONDS
[DEBUG] wire - << "<rapi:documents xmlns:rapi="http://marklogic.com/rest-api">rapi:documentrapi:uri/bulkTransacton/foo10.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:documentrapi:documentrapi:uri/bulkTransacton/foo11.xml/rapi:urirapi:categorymetadata/rapi:categoryrapi:categorycontent/rapi:categoryrapi:mime-typeapplication/xml/rapi:mime-type/rapi:document/rapi:documents[\n]"
[DEBUG] ThreadSafeClientConnManager - Released connection is reusable.
[DEBUG] ConnPoolByRoute - Releasing connection [HttpRoute[{}->http://localhost:8011]][null]
[DEBUG] ConnPoolByRoute - Pooling connection [HttpRoute[{}->http://localhost:8011]][null]; keep alive for 5000 MILLISECONDS
[DEBUG] ConnPoolByRoute - Notifying no-one, there are no waiting threads
[DEBUG] ThreadSafeClientConnManager - Get connection: HttpRoute[{}->http://localhost:8011], timeout = 0
[DEBUG] ConnPoolByRoute - [HttpRoute[{}->http://localhost:8011]] total kept alive: 1, total issued: 0, total allocated: 1 out of 200
[DEBUG] ConnPoolByRoute - Getting free connection [HttpRoute[{}->http://localhost:8011]][null]
[DEBUG] DefaultHttpClient - Stale connection check
[DEBUG] RequestAddCookies - CookieSpec selected: best-match
[DEBUG] RequestAddCookies - Cookie [version: 0][name: HostId][value: 18106243054103630114][domain: localhost][path: /v1][expiry: null] match [localhost:8011/v1/documents]
[DEBUG] RequestAuthCache - Auth cache not set in the context
[DEBUG] DefaultHttpClient - Attempt 1 to execute request
[DEBUG] DefaultClientConnection - Sending request: GET /v1/documents?category=content&format=xml&uri=/bulkTransacton/foo0.xml&uri=/bulkTransacton/foo1.xml&uri=/bulkTransacton/foo2.xml&uri=/bulkTransacton/foo3.xml&uri=/bulkTransacton/foo4.xml&uri=/bulkTransacton/foo5.xml&uri=/bulkTransacton/foo6.xml&uri=/bulkTransacton/foo7.xml&uri=/bulkTransacton/foo8.xml&uri=/bulkTransacton/foo9.xml&uri=/bulkTransacton/foo10.xml&uri=/bulkTransacton/foo11.xml HTTP/1.1
[DEBUG] wire - >> "GET /v1/documents?category=content&format=xml&uri=/bulkTransacton/foo0.xml&uri=/bulkTransacton/foo1.xml&uri=/bulkTransacton/foo2.xml&uri=/bulkTransacton/foo3.xml&uri=/bulkTransacton/foo4.xml&uri=/bulkTransacton/foo5.xml&uri=/bulkTransacton/foo6.xml&uri=/bulkTransacton/foo7.xml&uri=/bulkTransacton/foo8.xml&uri=/bulkTransacton/foo9.xml&uri=/bulkTransacton/foo10.xml&uri=/bulkTransacton/foo11.xml HTTP/1.1[\r][\n]"
[DEBUG] wire - >> "Accept: multipart/mixed; boundary=Boundary_3_187965576_1406165986593[\r][\n]"
[DEBUG] wire - >> "Authorization: Digest username="usr1",realm="public",nonce="50d5b60b853b0bd2cd594ed63a6df144",opaque="a356e486d94715d7",qop=auth,uri="/v1/documents",cnonce="d226a6da",nc=00000004,response="79f7381d4bedecf1c05e1119f231c6a1"[\r][\n]"
[DEBUG] wire - >> "Host: localhost:8011[\r][\n]"
[DEBUG] wire - >> "Connection: Keep-Alive[\r][\n]"
[DEBUG] wire - >> "Cookie: HostId=18106243054103630114[\r][\n]"
[DEBUG] wire - >> "Cookie2: $Version=1[\r][\n]"
[DEBUG] wire - >> "[\r][\n]"
[DEBUG] headers - >> GET /v1/documents?category=content&format=xml&uri=/bulkTransacton/foo0.xml&uri=/bulkTransacton/foo1.xml&uri=/bulkTransacton/foo2.xml&uri=/bulkTransacton/foo3.xml&uri=/bulkTransacton/foo4.xml&uri=/bulkTransacton/foo5.xml&uri=/bulkTransacton/foo6.xml&uri=/bulkTransacton/foo7.xml&uri=/bulkTransacton/foo8.xml&uri=/bulkTransacton/foo9.xml&uri=/bulkTransacton/foo10.xml&uri=/bulkTransacton/foo11.xml HTTP/1.1
[DEBUG] headers - >> Accept: multipart/mixed; boundary=Boundary_3_187965576_1406165986593
[DEBUG] headers - >> Authorization: Digest username="usr1",realm="public",nonce="50d5b60b853b0bd2cd594ed63a6df144",opaque="a356e486d94715d7",qop=auth,uri="/v1/documents",cnonce="d226a6da",nc=00000004,response="79f7381d4bedecf1c05e1119f231c6a1"
[DEBUG] headers - >> Host: localhost:8011
[DEBUG] headers - >> Connection: Keep-Alive
[DEBUG] headers - >> Cookie: HostId=18106243054103630114
[DEBUG] headers - >> Cookie2: $Version=1
[DEBUG] wire - << "HTTP/1.1 200 OK[\r][\n]"
[DEBUG] wire - << "Content-type: multipart/mixed; boundary=Boundary_3_187965576_1406165986593[\r][\n]"
[DEBUG] wire - << "Server: MarkLogic[\r][\n]"
[DEBUG] wire - << "Content-Length: 0[\r][\n]"
[DEBUG] wire - << "Connection: Keep-Alive[\r][\n]"
[DEBUG] wire - << "Keep-Alive: timeout=5[\r][\n]"
[DEBUG] wire - << "[\r][\n]"
[DEBUG] DefaultClientConnection - Receiving response: HTTP/1.1 200 OK
[DEBUG] headers - << HTTP/1.1 200 OK
[DEBUG] headers - << Content-type: multipart/mixed; boundary=Boundary_3_187965576_1406165986593
[DEBUG] headers - << Server: MarkLogic
[DEBUG] headers - << Content-Length: 0
[DEBUG] headers - << Connection: Keep-Alive
[DEBUG] headers - << Keep-Alive: timeout=5
[DEBUG] DefaultHttpClient - Connection can be kept alive for 5000 MILLISECONDS
[DEBUG] ThreadSafeClientConnManager - Released connection is reusable.
[DEBUG] ConnPoolByRoute - Releasing connection [HttpRoute[{}->http://localhost:8011]][null]
[DEBUG] ConnPoolByRoute - Pooling connection [HttpRoute[{}->http://localhost:8011]][null]; keep alive for 5000 MILLISECONDS
[DEBUG] ConnPoolByRoute - Notifying no-one, there are no waiting threads