Comments (5)
Thanks for the tests @Zipunrar , I'm trying them out now.
from java-client-api.
@Zipunrar Thanks again for the test, made debugging very easy.
I haven't identified why yet, but "unknown" seems to be a special case. If I change that to "unknown.xml" or even "unknownn", I get the expected 404 and ResourceNotFoundException
from ML. But the specific value "unknown" results in a 204 No Content being returned.
Can you try your test with "unknown.xml" and "unknownn" (or any word besides "unknown") as the URI? Curious if you get the same results.
from java-client-api.
Hi @rjrudin ,
very interesting. Never thought the URI could lead to such strange behavior. I tried some different values and get other results depending on the value of the URI.
- "unknown", "unknown.xml", "foobar", "unknownn" produces failed tests for both property and collection patching
- "foo/bar.xml", "check", "simple/test/with/random/uri.json" however does only fail for the property patch not for the collection or document patch
- I didn't find values to let only the collection patching fail
- In all cases the patching document test never fails and the expected exception will be thrown
from java-client-api.
Revisiting this - for patching document properties, I verified that the underlying server functions - xdmp:document-set-properties
and xdmp:document-add-properties
- do not throw an error if the URI is not found. So the third test that invokes addPropertyValue
is behaving correctly.
However, I'm able to produce the same behavior in qconsole - i.e. xdmp:document-set-collections
will fail for some URIs but not throw an error for other URIs. If I run a "clear" operation on the database, then the function will fail for all URIs. So it appears to be a server issue where URIs perhaps associated with deleted documents do not always result in an error being thrown. Will investigate further - but I don't think this has anything to do with the Java Client or the REST API.
Will leave this open until I isolate the server issue.
from java-client-api.
@Zipunrar I think I know the explanation. As noted above, performing any "properties" operations on a URI will succeed and results in a properties fragment for the URI being created - even though there's not a document for that URI. So if you start with an empty database, you still won't see any documents in qconsole, but you will see a fragment count of 1 in the Admin UI for that database.
Once the URI is associated with a properties fragment, all metadata operations will succeed on that URI. If you clear the database, that will delete the properties fragment, and then all metadata operations (including PATCH requests) will throw an error as expected.
With your test, if you were to run it twice, the test that adds a collection would not throw an error because the test that adds a property would have resulted in the URI being created with a properties fragment associated with it.
Thus, I do not believe there is a bug here - the behavior with the Java Client and REST API is consistent with how the server functions work when a URI is involved that only has a properties fragment associated with it.
from java-client-api.
Related Issues (20)
- Enabling compression and chunking in MarkLogic 10 in Java Client API
- 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
- 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
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.