This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes lock & read or just read? 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 "lock & read or just read? " Watch "lock & read or just read? " New topic
Author

lock & read or just read?

Alex Sharkoff
Ranch Hand

Joined: Apr 11, 2004
Posts: 209
Hi all,

My assignment has the following comment on the lock(int) method: Locks a record so that it can only be updated or deleted by this client.. So what I am thinking is to only use the physical locking (ie locking on the database file) when reading a record. An additional record locking (along with physical locking) will be only used when updating/deleting a record.

DBClient class



Data class:


Do you think it is an appropriate approach to the read method?


[ December 08, 2005: Message edited by: Alex Sharkoff ]

Alex (SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCJD 1.4)
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11730
    
116

Hi Alex,

I think that is suitable for the read method.

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Alex Sharkoff
Ranch Hand

Joined: Apr 11, 2004
Posts: 209
thanks a lot, Andrew.

 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: lock & read or just read?
 
It's not a secret anymore!