I'm done with the criteriaFind() method, now I'm working the locking and unlocking problem. I have a pretty good idea of how to implement this by using a HashSet, but I'm stuck on testing the code, especially how to simulate the concurrent access part. Should I just create lots of threads, and use them to test the DB? If yes, how can I make sure that threads are accessing the methods at the same time? Since in the execution, every thread takes sometime to execute. Any help is appreciated!