[JAVA-4856] Ensure ObjectId uniqueness when using GraalVM Created: 24/Jan/23  Updated: 28/Oct/23  Resolved: 09/Feb/23

Status: Closed
Project: Java Driver
Component/s: Native Images
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Kai Orend Assignee: Maxim Katcharov
Resolution: Fixed Votes: 0
Labels: graalvm
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to JAVA-3537 GraalVM support Closed
is related to JAVA-3580 Test against graalvm and test native-... Backlog
Documentation Changes: Not Needed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

A customer stumbled over duplicate errors caused by duplicate ObjectIds which were generated on different Servers, while using GraalVM.  

It looked like the SecureRandom implementation did generate deterministic values rather than non  deterministic ones.  

Add a native-image.properties to bson and include Args = --initialize-at-run-time=org.bson.types.ObjectId
Refs: https://www.graalvm.org/latest/reference-manual/native-image/dynamic-features/JCASecurityServices/#securerandom



 Comments   
Comment by Githook User [ 06/Feb/23 ]

Author:

{'name': 'Maxim Katcharov', 'email': 'maxim.katcharov@mongodb.com', 'username': 'katcharov'}

Message: Initialize ObjectId, ClientMetadataHelper at runtime, GraalVM (#1078)

JAVA-4856
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/493b2485d8140f574129e5b8f3cf39c637dd7805

Comment by Jeffrey Yemin [ 24/Jan/23 ]

References:

We should check with Quarkus maintainers to see whether this is a problem for every Quarkus user.

Generated at Thu Feb 08 09:03:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.