title: How to acquire a lock and force release it after some time? Java
body: <p>I have a problem with database and java threads deadlocks, so is it possible to set some time for java thread to be inside lock, and release it then, to prevent all system hang? By this trick I want to release lock in DB to return system to normal workflow and no matter that some query would fail...</p>