File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Lock testing UB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Lock testing UB" Watch "Lock testing UB" New topic

Lock testing UB

Jari Timonen
Ranch Hand

Joined: Jan 16, 2004
Posts: 232
Hello all,

I've made my Data-class and my locking is done. I also have multithreadtest-class that generates requests. I have a problem. How to verify that everything is going like it should be?
I outputs all locks, unlocks, create...

Any ideas?

I've run it with 100 clients, 10 records, 400 hits per client and everything is going smoothly. (no deadlocks, no exceptions)

SCJP 5.0, SCJD URLyBird 1.3.3, OCMJEA 5 (SCEA) Factory Homes
Roberto Perillo

Joined: Dec 28, 2007
Posts: 2271

Hey, partner!!!

Have you tried this already?!

Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Alecsandru Cocarla
Ranch Hand

Joined: Feb 29, 2008
Posts: 158
You can also try my UB test, but from what I understand you already have something that outputs every step, so this is maybe quite similar. What you can do is run it with a big amount of threads and records and see if the database is still valid at the end.

I think there are also some other multithreaded tests around, so try a search and see what you can find.

SCJP 1.4 100%
SCJD 99.5%
Jari Timonen
Ranch Hand

Joined: Jan 16, 2004
Posts: 232
Thanks, i've seen all of those links. I've used some parts from them and written my own version, since none of them was using my DBMain iface. (Or they were too strongly coupled)

The main issue still is in every single test: How to verify that the final result is valid?

I need some kind of tracker of what's been done and how many times and in which order. Then crossreference to actual db-file... (sounding too superstitious?)

Now running 200 threads, 30 varitaty records x 300 hits per thread. all ok.
I agree. Here's the link:
subject: Lock testing UB
It's not a secret anymore!