GeeCON Prague 2014*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes locking the entire db?? 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 "locking the entire db??" Watch "locking the entire db??" New topic
Author

locking the entire db??

subu ananthram
Ranch Hand

Joined: May 16, 2004
Posts: 102
Howdy,
I am wondering if there is another way out of this sticky situation.
I have a file access class like many others that my Data class calls.
Now I synchronize on the random acces file instance which is static to my fileaccess class and there is only one instance of my file access class
the idea is so that one thread at a time plays with the raf and my file pointers dont go crazy .This will make the application perform badly since only one thread can do anything with the random access file ...Is there some other way of doing this...Please comment
Subu
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
Just make sure the synchronised blocks are as small as possible.


42
 
wood burning stoves
 
subject: locking the entire db??