aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes a simple question of Locking mechanism Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "a simple question of Locking mechanism" Watch "a simple question of Locking mechanism" New topic
Author

a simple question of Locking mechanism

Gerenne Vives
Ranch Hand

Joined: Feb 05, 2005
Posts: 60
Hello ,

I have a simple question , It is necesary to use the lock class when I search a record in mode networked ?

Thanks
dennis du
Ranch Hand

Joined: Dec 31, 2004
Posts: 59
No,there is no need to lock for the read operation.


-------------------------------<br />OCP 9i <br />SCJP/SCJD/SCWCD(92%)/SCDJWS<br />XML(IBM Test 141)<br />Who is the next?SCBCD<br />SCBCD/CCNA/CCNP/PMP<br />not sure
dennis du
Ranch Hand

Joined: Dec 31, 2004
Posts: 59
This is a general rule from database field.
Gerenne Vives
Ranch Hand

Joined: Feb 05, 2005
Posts: 60
ok ,thanks for your help.

Irene.
Frank Verbruggen
Ranch Hand

Joined: Feb 01, 2005
Posts: 37
It is not needed.

But, I chose to lock the entire database when I do any operation.
This seems like a dumb thing at first, but it saves u a lot of scenario testing for your locking scheme.
Furthermore, good table based locking (not the one we are implementing) is FASTER than record based locking.
This is because of the lack of overhead on row level locks.
So even though it is not needed to lock when reading, I would (and do).
Document your decisions well !
Good luck


----------------<br />SCJP (98%)<br />SCJD (81%)<br />SCEA (near future)
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Frank Verbruggen:
It is not needed.

But, I chose to lock the entire database when I do any operation.
This seems like a dumb thing at first, but it saves u a lot of scenario testing for your locking scheme.
Furthermore, good table based locking (not the one we are implementing) is FASTER than record based locking.
This is because of the lack of overhead on row level locks.
So even though it is not needed to lock when reading, I would (and do).
Document your decisions well !
Good luck


Will it not affect the number of concurreny users access? Since the data item granularity is so large like that to the table, I am quite sure that some other users might not be able to access that table during the time someone is accessing it...


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: a simple question of Locking mechanism