Getting a little farther on this one. Here is what is happening now. (And the second read shown above no longer fixes the problem.)
I'm getting this error:
java.io.IOException: Bad file descriptor
at java.io.RandomAccessFile.seek(Native Method)
at suncertify.db.Data.readRecord(Data.java:115)
at suncertify.db.Data.lockRecord(Data.java:442)
I have multiple threads out there, and each is grabbing a singleton Data instance and then calling the Data.lock method. My lock method has this:
I would expect that only one
thread would be getting into this synchronized block on lockedRooms at a time, so only one thread would be hitting the singleton Data instance at one time with the readRecord method. The Data.readRecord method is a synchronized method.
I realize that this is a nexted synchronization, but I followed Andrew's idea of documenting all the synchronization paths in
nexted synchronization thread, and I couldn't find any potential deadlock situations.
Ideas on the "bad file descriptor"? All I have found so far on this is that it means something about the file system being inconsistent.
TJ