• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic