wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLyBird: Please Help! Non-deterministick error with database record reading 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 "URLyBird: Please Help! Non-deterministick error with database record reading" Watch "URLyBird: Please Help! Non-deterministick error with database record reading" New topic
Author

URLyBird: Please Help! Non-deterministick error with database record reading

Pawel Solarski
Greenhorn

Joined: Jul 31, 2009
Posts: 2
Hi, I have a strange error occuring very rare during the tests of the database file record reading, with the usage of RadomAccessFile.

Then I execute the JUnit test when many threads trying to read random record and get this strange result:



I start with populating the static cache of database in the JUnit during the junit class loading (similar to JUnit4 beforeClass()):


After that, many threads are created, each one trying to read some random record:


And the simple code of RecordReader thread:


It happens very rare and with different records, no matter if a set the thread count to 10 or to 100. I looked through the log and found no other threads trying to change the file pointer. Do you have any idea of what can be wrong?

SCJP 5.0
Matheus Mendes
Ranch Hand

Joined: May 15, 2007
Posts: 66
Hi Pawel,

Man I don't know the Urly Bird spec but the problem that you mention seems to be a field length problem. I had a problem as yours on my project, I wasn't counting the first byt that indicates the total length, So sometimes my updates and selects came like yours are coming.

Well, it's just a wondering.... Try to log even more details and post here...

Hope you found this problem soon, wish you lucky


The Death of one is a tragedy, but the Death of a million is just a statistic. Joseph Stalin

SCJP 6.0, SCJD
Jari Timonen
Ranch Hand

Joined: Jan 16, 2004
Posts: 232
Have you tried with only one thread? If it does not fail, your threading/locking has issues. Without seeing actual reading of the file, it's hard to determine what's going wrong.

(remember forum rules about pasting entire sections of actual submission code)


SCJP 5.0, SCJD URLyBird 1.3.3, OCMJEA 5 (SCEA) Factory Homes
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: URLyBird: Please Help! Non-deterministick error with database record reading