Comments (8)
I still see this happening on binary documents, here is my test
String docId[] = {"Pandakarlino.jpg","mlfavicon.png"};
BinaryDocumentManager docMgr = client.newBinaryDocumentManager();
DocumentWriteSet writeset =docMgr.newWriteSet();
File file1= null,file2=null;
file1 = new File("src/junit/com/marklogic/javaclient/data/" + docId[0]);
FileHandle handle1 = new FileHandle(file1);
writeset.add("/1/"+docId[0],handle1.withFormat(Format.BINARY));
file2 = new File("src/junit/com/marklogic/javaclient/data/" + docId[1]);
FileHandle handle2 = new FileHandle(file2);
writeset.add("/1/"+docId[0],handle2.withFormat(Format.BINARY));
docMgr.write(writeset);
I see
com.marklogic.client.FailedRequestException: Local message: failed to apply resource at documents: Bad Request. Server Message: XDMP-CONFLICTINGUPDATES: xdmp:document-insert("/1/Pandakarlino.jpg", document{binary{"89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff61000000097048597300000b1300000b1301009a9c1800000a4f694343505068..."}}, (<sec:permission xmlns:sec="http://marklogic.com/xdmp/security">sec:capabilityupdate/sec:capabilitysec:role-id155206546613.../sec:permission, <sec:permission xmlns:sec="http://marklogic.com/xdmp/security">sec:capabilityread/sec:capabilitysec:role-id70893385306317.../sec:permission), (), 0, ()) -- Conflicting updates xdmp:document-insert("/1/Pandakarlino.jpg", document{binary{"89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff61000000097048597300000b1300000b1301009a9c1800000a4f694343505068..."}}, (<sec:permission xmlns:sec="http://marklogic.com/xdmp/security">sec:capabilityupdate/sec:capabilitysec:role-id15520654661378671735/sec:role-id/sec:permission, <sec:permission xmlns:sec="http://marklogic.com/xdmp/security">sec:capabilityread/sec:capabilitysec:role-id7089338530631756591/sec:role-id/sec:permission), (), 0) and xdmp:document-insert("/1/Pandakarlino.jpg", document{binary{"ffd8ffe000104a46494600010101004800480000ffdb0043000604040405040605050609060506090b080606080b0c0a0a0b0a0a0c100c0c0c0c0c0c100c0e0f..."}}, (<sec:permission xmlns:sec="http://marklogic.com/xdmp/security">sec:capabilityread/sec:capabilitysec:role-id7089338530631756591/sec:role-id/sec:permission, <sec:permission xmlns:sec="http://marklogic.com/xdmp/security">sec:capabilityupdate/sec:capabilitysec:role-id15520654661378671735/sec:role-id/sec:permission), (), 0)
at com.marklogic.client.impl.JerseyServices.checkStatus(JerseyServices.java:4038)
at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3358)
at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3429)
at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:421)
at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:408)
at com.marklogic.javaclient.TestBulkWriteSample1.testWriteMultipleBinaryDoc(TestBulkWriteSample1.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
from java-client-api.
Sravan, if I understand your example properly, I believe XDMP-CONFLICTINGUPDATES is a legitimate error in this case. You're including multiple updates for the same document in the same request. Much as if you did (xdmp:document-insert("foo",...), xdmp:document-insert("foo"),...)).
That differs from the original problem. An update to content and metadata for the same document (submitted through a single add operation) is supposed to be treated as a single update.
from java-client-api.
Sravan, do you think we should add a request for enhancement that the API throw a clear error immediately when you try to add a second document with the same URI to the DocumentWriteSet?
from java-client-api.
BTW, the originally reported problem appears to work correctly now, on the dev branch.
from java-client-api.
This can be closed from my perspective. Reassigning to Sravan in case he wants to address Sam's question, above, or do anything different with the tests.
If not, I think you can go ahead and close this, Sravan.
from java-client-api.
Or not...Apparently I can't assign anything to Sravan, so I'm just going to close this.
from java-client-api.
Since I was able to reassign to Sravan, I'll reopen so he can test.
from java-client-api.
Verified and added a functional test
from java-client-api.
Related Issues (20)
- DMSDK has troubles with tiered storage offline HOT 8
- Transfer Encoding has non-emtpy body when no result in returned through okhttp HOT 3
- op.sampleBy misses the 0 parameter overloaded method HOT 1
- Delete temporal documents via DMSDK HOT 2
- Specifi page length and startIndex for dataMOvementManager using newQueryBatcher HOT 3
- Upgrade to jackson-databind 2.14.0 when available HOT 2
- WriteBatcher does not write documents when total documents provided is less than 100 and without using withBatchSize HOT 1
- SparQL query throws unexpected error HOT 3
- Executing PatchHandle against non-existing Document does not throw an Exception HOT 5
- Incorrectly return empty query result HOT 3
- Support for Java 17? HOT 8
- Numbers returned by MarkLogic do not use scientific notation HOT 1
- Implementations of innerSerialize lack proper namespace HOT 11
- Feature Request: OptimisticLockingExecption HOT 7
- Request for Jakarta EE 10 compliant version HOT 18
- Remove "ML-Check-ML11-Headers" for ML11 java client api HOT 1
- Directory queries allow for invalid values of "depth" without throwing an error HOT 3
- Wrong timeout conversion in awaitCompletion HOT 4
- search:and-not-query is ignored in QueryBatcher HOT 6
- queryManager.uris does not honor additional-query in search options HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-client-api.