• Post Reply Bookmark Topic Watch Topic
  • New Topic

Database lock() method test.

 
Marcin Mroczkowski
Greenhorn
Posts: 17
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Below test can throughtly check blocking ability of database .lock() method. This feature is one of the most important MUSTS in OCMJD assignment, and it's commonly overlooked by standard tests. This code locks random records, and then creates additional threads, to check two things:
- if .lock() method blocks other threads for locking same record
- if record is not locked, it can be always locked with no problems

If code deadlocks, its simple mean that .lock() method erroneously blocked, when record is not locked by other thread.

 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!