Giter Site home page Giter Site logo

Comments (8)

sravanr avatar sravanr commented on June 5, 2024

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.

kcoleman-marklogic avatar kcoleman-marklogic commented on June 5, 2024

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.

sammefford avatar sammefford commented on June 5, 2024

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.

kcoleman-marklogic avatar kcoleman-marklogic commented on June 5, 2024

BTW, the originally reported problem appears to work correctly now, on the dev branch.

from java-client-api.

kcoleman-marklogic avatar kcoleman-marklogic commented on June 5, 2024

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.

kcoleman-marklogic avatar kcoleman-marklogic commented on June 5, 2024

Or not...Apparently I can't assign anything to Sravan, so I'm just going to close this.

from java-client-api.

sammefford avatar sammefford commented on June 5, 2024

Since I was able to reassign to Sravan, I'll reopen so he can test.

from java-client-api.

sravanr avatar sravanr commented on June 5, 2024

Verified and added a functional test

from java-client-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.