How to lock a file on different application levels?
问题 Here's the scenario: I have a multi threaded java web application which is running inside a servlet container. The application is deployed multiple times inside the servlet container. There are multiple servlet containers running on different servers. Perhaps this graph makes it clear: server1 +- servlet container +- application1 | +- thread1 | +- thread2 +- application2 +- thread1 +- thread2 server2 +- servlet container +- application1 | +- thread1 | +- thread2 +- application2 +- thread1 +-