Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

FileLock - how to release locks on files no longer used.

807591Mar 17 2008 — edited Mar 17 2008
Hi Everyone,

Well its a bad problem to begin with, but I have managed to create this monster somehow! I am trying to implement exclusive locks on files when they are accessed. I am using FileLock/ FIleChanell lock() method for this purpose. The thing is my release lock code is not getting called at the right times. So when you close the file, the lock isn't relased. Since I am testing some use cases, there are lot of file with somewhat "orphan" locks. Is there anyway to release these locks on files which are no longer used? I am on Windows XP ( I hate it) ! I don't know how to do something like this.

Thanks in advance ! This prob is drivng me nuts..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 14 2008
Added on Mar 17 2008
3 comments
304 views