Just want to report back - so far I haven't run into the file locking issue after
Hi Alan,Thank you very much for the reply, and the link. I'm using Windows so thatcould be it. I will give it a try and see if it happens again.Yes. I'm using modjy and WSGI. I'll give modjy's reloading a try.Thanks again!JackOn Mon, Nov 12, 2012 at 1:02 PM, Alan Kennedy <email@example.com> wrote:
> I'm using web.py with Jython. web.py dynamically load .py files whenJython only needs to open source files for read since it does not write them. Moreover, it does not lock the files.
> a .py file has changed. This works well in CPython. However when I
> try to do the samething when running web.py with Jython, I sometimes
> (but not always) get an error when I try to save the file. The error says
> something like the file is currently being used by another process. My
> guess is that the process is the JVM. And my guess is that in certain
> stage of running a .py file the Jython interpreter locks the .py files. Is
> this the case? Is this by design?
The fact that it is intermittent makes me think that it is dependent on operating system concerns.
What operating system are you using? If it's Windows, I find that there is often contention between processes on file, as described on this page, which includes a possible fix.
Avoiding JAR and file locking under Windows
If you are using *nix, there may be other concerns.
What is the difference beween the times when it works and the times when it doesn't?
- Are you closing the editor?
- Are you closing the file in the editor?
What is the editor? Is it an IDE, like Eclipse?Are you using WSGI? And modjy?
> With this problem I often have to shutdown and restart tomcat, which
> takes a lot of efficiency away.
You might try modjy's reloading capabilities.