-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oracle.soda.OracleOperationBuilder#mergeOne sets json_document to null #14
Comments
We'll take a look and get back to you, can you please let us know which database release you're trying this against? |
This is 18.12.0.0.201020. |
Thanks, we'll take a look and get back to you asap. |
Reproduced and identified the issue, working on a fix (it's not in the setPayload ... methods). Our apologies for this bug. I'll post an update here very soon. |
@aoksenholt @petteja we're working on getting the a new SODA jar out with this fix. Have you compiled SODA from source? If so, would it be helpful to commit the source file fix sooner for you guys, so that you can compile from source? Or would you prefer to just wait until we publish the new jar? |
We're doing a workaround using replace instead of merge (manually handling the merge), but it is nice if you would commit code before new release is ready so we'll be able to test it. |
@aoksenholt ok, will do that soon (the fix is undergoing our internal testing now). |
@aoksenholt @petteja I uploaded the source code fix for this issue, as well as some other efficiency improvements for merge methods. The changes only affect one file, OracleOperationBuilderImpl.java. Please feel free to recompile and test. The new release (1.1.8) with these fixes will be out shortly. Important: under the covers, both mergeOne and mergeOneAndGet methods require an extra round-trip when versioning methods are hash based (i.e. SHA256, MD5). This is because hash based versioning methods require computation of the version on the updated content, and that's not easily doable in the same single round-trip during which the content is updated. To avoid this extra round-trip, and thus significantly improve performance of the merge methods, please use UUID versioning or another non-hash based SODA versioning method (note also that UUID is the new SODA versioning default method when running against 21c or above database, assuming compatible is set to 20 and above. It's a highly efficient versioning method, and we recommend using it unless there's a very strong reason to use another non-hash based versioning method). Here's how to create a collection with the default shape but versioning set to UUID instead of SHA256 (which is the default when running against pre 21c database, and hence also 18c, which you're using):
|
Nice! |
When doing
collection.find().key(key).mergeOne(documentToMerge)
where
documentToMerge.contentAsString.length
> 4000 the json_document column is set to null without any exception or errorThe JSON_DOCUMENT column is of type BLOB, see metadata below.
Jdbc-driver used: ojdbc8
Should
oracle.soda.rdbms.impl.TableCollectionImpl#setPayloadBlobWorkaround
be used at https://github.com/oracle/soda-for-java/blob/master/src/oracle/soda/rdbms/impl/TableCollectionImpl.java#L2410 instead oforacle.soda.rdbms.impl.TableCollectionImpl#setPayloadBlob
?The text was updated successfully, but these errors were encountered: