wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes lock() Client side or Back end? 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() Client side or Back end?" Watch "lock() Client side or Back end?" New topic
Author

lock() Client side or Back end?

Song Jing Lim
Ranch Hand

Joined: Feb 11, 2003
Posts: 56
I need implement below methods...

But I don' tknow those methods will be internal use by Data.java or will call from front end UI?

If use by front end (UI) that means once user select a account to modify, system will check either record had lock for by other user and return modify not allow?

Any guide on that?

// 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;
// Releases the lock on a record.
public void unlock(int recNo) throws RecordNotFoundException;
// Determines if a record is currenly locked. Returns true if the
// record is locked, false otherwise.
public boolean isLocked(int recNo)
throws RecordNotFoundException;


Rgds,<br />Song Jing
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Hi Song

There is no silver built here, you must decide for your self.
Take a look on :
http://www.coderanch.com/t/184224/java-developer-SCJD/certification/Should-lock-methods-callable-client

Regards M


SCJP, SCJD, SCWCD, OCPJBCD
Joe Zhou
Ranch Hand

Joined: Oct 18, 2006
Posts: 34
The easiest way is to do the locking at the backend.
There are hundreds post on this topic on this forum. You may search
them by key word 'locking'
Song Jing Lim
Ranch Hand

Joined: Feb 11, 2003
Posts: 56
Thanks....

 
Don't get me started about those stupid light bulbs.
 
subject: lock() Client side or Back end?