This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "lock() Client side or Back end?" Watch "lock() Client side or Back end?" New topic

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 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: 918

Hi Song

There is no silver built here, you must decide for your self.
Take a look on :

Regards M

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

I agree. Here's the link:
subject: lock() Client side or Back end?
jQuery in Action, 3rd edition