This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Questions! Questions! Questions!" Watch "Questions! Questions! Questions!" New topic
Author

Questions! Questions! Questions!

Terry McKee
Ranch Hand

Joined: Sep 29, 2000
Posts: 173
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.
Br,
Ban
Terry McKee
Ranch Hand

Joined: Sep 29, 2000
Posts: 173
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: http://aspose.com/file-tools
 
subject: Questions! Questions! Questions!
 
Similar Threads
criteriaFind
Difference between find() and criteriaFind()
design comments ...
criteriaFind method question
please review criteriaFind -> good riddance from hateful "ANY"