I have a properties configuration file that is accessed by one application and can be modified by another. I need to ensure the reads and writes are synchronized, so that is where I found Apache's Commons-Configuration2 version of PropertiesConfiguration. The documentation states that access to the file can be synchronized similarly as a Read Write lock. However, I couldn't determine the extent of the lock, is it only between threads in the same application or the entire file itself?
How Thread Safe Is Commons-Configuration2 Synchronizer Across Independent Applications
130 views Asked by Chen At
1
There are 1 answers
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in THREAD-SAFETY
- Multiple Processes, Multiple Processors, Single Priority Queue - Java Thread-Safe and Concurrency -
- Thread-safe lock-free min where both operands can change c++
- Atomic increment operation in C++?
- In Java, a currying function is thread-safe or not
- How can I make my flask + sqlite3 application threadsafe
- Thread task not exiting when atomic value changed
- Issues with Concurrent Execution and Synchronization in a Custom Java Caching Mechanism
- Why is SpringApplicationBuilder.run made as thread-safe?
- lua_continuation, lua_thread functions
- Virtual threads in Java with backwards compatibility
- AWS Go SDK V2: assuming different roles concurrently
- Why does my PyQt5 and Vispy application only update the GUI when adding sleep in QThread's loop?
- Different threads updating different attribute of the same object, will it work?
- How to avoid Duplicate Document Numbers for Invoice created through netsuite RESTAPI
- In Rust, how to create a globally shared singleton with `OnceLock`?
Related Questions in APACHE-COMMONS-CONFIG
- How can I use a different separator for interpolation lookups?
- How to read a list from a YAMLConfigutation
- How to build HierarchicalConfiguration object from xml string content?
- PropertiesConfiguration doesn't reload with Symbolic link
- How to temporarily fail/disable REST APIs at runtime?
- Apache Commons Configuration
- How to add new XML element to the root element of a hierarchical XML configuration with addProperty() in Apache Commons Configuration?
- How to query XMLConfiguration by value with XPath in Apache Commons Configuration?
- How Thread Safe Is Commons-Configuration2 Synchronizer Across Independent Applications
- java.lang.NoClassDefFoundError error apache commons configuration
- Apache Commons Configuration File Location Strategies
- Apache Commons Configurations2
- Wildfly 17: "User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable." using commons-configuration2
- Is there a way to provide default values for env variables in a properties file with apache-commons?
- Passing Variable "aaa.bbb" into a Docker Container Process
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
If I understood your question correctly you want to lock and synchronize the config file on your drive.
Process synchronization
And you are right Commons-Configuration2 sync capabilities. It only supports synchronization between threads within the same process (just like most frameworks with build in synchronization features). The Commons-Configuration2 docs have some good examples for thread safety.
File synchronization
Commons-Configuration2 reads the config file to memory and than realeses it. You can delete or modify it while the program is still running. Commons-Configuration2 will not read the file again unless you tell it to do so. If you want to lock the file and prevent modification take a look at FileLocks.
If you want to watch for modification you should have a look at FileWatchers.