Just want to report back - so far I haven't run into the file locking issue after
applying the fix mentioned in Alan's email. However, modjy's reloading does not
seem to work (jython 2.5.3) so I'll continue to use web.py's reloading.

On Mon, Nov 12, 2012 at 3:15 PM, jlist9 <jlist9@gmail.com> wrote:
Hi Alan,

Thank you very much for the reply, and the link. I'm using Windows so that
could 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!

On Mon, Nov 12, 2012 at 1:02 PM, Alan Kennedy <jython-dev@xhaus.com> wrote:

> I'm using web.py with Jython. web.py dynamically load .py files when
> 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?

Jython only needs to open source files for read since it does not write them. Moreover, it does not lock the files.

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?

> With this problem I often have to shutdown and restart tomcat, which
> takes a lot of efficiency away.

Are you using WSGI? And modjy?

You might try modjy's reloading capabilities.