File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes blocking the code /application 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 "blocking the code /application" Watch "blocking the code /application" New topic

blocking the code /application

pramod karnani
Ranch Hand

Joined: May 22, 2007
Posts: 88

Hi All,

// Locks a record so that it can only be updated or deleted by this client.
// If the specified record is already locked, the current thread gives up
// the CPU and consumes no CPU cycles until the record is unlocked.
public void lock(int recNo) throws RecordNotFoundException;

For e.g . when lock method locks a contractor record 1


if unlock is not called again there will be lock method call


then it should block the code , correct?
Since record number 1 is not release so it will block the code until record number 1 is released.

K. Tsang

Joined: Sep 13, 2007
Posts: 3131

You may want to look at this thread

K. Tsang JavaRanch SCJP5 SCJD OCPJP7 OCPWCD5 OCPBCD5 OCPWSD5 OCMJEA5 part 1 part 2/3
I agree. Here's the link:
subject: blocking the code /application
It's not a secret anymore!