Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Questions! Questions! Questions! 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 "Questions! Questions! Questions!" Watch "Questions! Questions! Questions!" New topic

Questions! Questions! Questions!

Terry McKee
Ranch Hand

Joined: Sep 29, 2000
Posts: 175
I have read many messages that indicate that the criteriaFind method doesn't need to be synchronized. I am very confused by this because there may be concurrent usage of the criteriaFind method. Also how is everyone breaking the functionality of this method up. I am trying not to make anything complex, but I fell that the parsing of the criteria should be done in a separate class that I call ParseUtilities. Any thoughts?
Andras Nemeth
Ranch Hand

Joined: Jul 31, 2001
Posts: 80
Hi Terry,
The reason is that only write lock needed as it is written in the specification. It is called also dirty read.
This kind of SELECT also (may) used in SQL.
Terry McKee
Ranch Hand

Joined: Sep 29, 2000
Posts: 175
The problem that I see is that let's say Client A and Client B both call the criteriaFind method at the same time. The method itself will have two threads running in it at the same time. Let's say that Client A is at the beginning of the method and Client B is at the end. This could cause problems. The variables that Client A and Client B are using are going to be trampled on if the method or block is synchronized.
Also, it looks like some people are loading data from the file into their program. I don't understand how that is flexible. Doesn't it make sense to keep the data where it is at? We can't guarantee that it is not a huge file.
I agree. Here's the link:
subject: Questions! Questions! Questions!
It's not a secret anymore!