How to access the file shared between different accessors?
Make sure that both the Java and Python methods close the file when they are done.
One possibility is to convert your Python script to Jython. If both processes are running in the JVM then you should be able to use standard Java concurrency techniques to make sure you do not have both threads modifying the file simultaneously.
I have code written on Java which writes all data to the file and then I have python script which handles this data.
They run completely separately and python script can be run by schedule but it also removing handled records from the file.
The question is in implementation for the access to the file when java code from first process will try to write something and python code from second process will try to remove handled record?
First thought was to have .lock file physically created when one of the processes updating the file but perhaps there are some other solutions to consider?
Thank you.