Closed arne-bdt closed 1 month ago
I'm unsure about this PR,
I set this PR to "draft" - hope you don't mind.
I found another "solution": Added a fail-fast mechanism: now throwing an ExceptionInInitializerError when a thread attempts to enter JenaSystem.init() while another thread is in the initialization process.
What do you think?
I think requiring single threaded initialization will break existing usage. Until we agree that it is the only option, I don't think we should go that way.
Discussion on the issue.
Added a fail-fast mechanism: now throwing an
ExceptionInInitializerError
when a thread attempts to enterJenaSystem.init()
while another thread is in the initialization process.Refactored
JenaSystem.init()
using the "Initialization-on-demand holder idiom" for simpler and safer initialization.Additionally, I have added integration tests for
JenaSystem.init()
, including the parallel execution scenario from the issue, to ensure coverage of potential concurrency issues.GitHub issue resolved #2787
By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.
See the Apache Jena "Contributing" guide.