• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S locking - client or server side

 
Maciek Falski
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiyah!

I almost have my B&S application completed. Unfortunately, I'm little confused about locking in my application.

I decided to do locking from server side, e.g. server update method is something like:

(db is DB interface implementation)

So, locking is taken a place at the most atomic level here.

The problem is than I'm not sure is this correct (I'm not native English spoken person). The assignment states: "Your server must be capable of handling multiple concurrent requests, and as a part of this capability, must provide locking functionality as specified in the interface provided above (DB interface)".

Could anyone tell me if my assumption is correct or how should it be done?

If locking must be done at client side, so what when record is locked be one client then other client's GUI should be frozen until record be unlocked?

Thanks,
Maciek
 
Brian Kelly
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do locking on the server (I did exactly as you did in my DB adapter class). Hence your server is providing "locking functionality as specified in the interface provided".

Trying to do locking on the client would be much more complicated.

 
Lucy Hummel
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maciek,

The code snipplet you presented looks similar to mine.

I do the locking and unlocking also on Server and not on Client side and I thing it a solution that Sun likes.

Br, Lucy
 
Maciek Falski
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian, Lucy,

Thanks a lot for response. Now I feel more confident about my locking strategy .

Cheers,
Maciek
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic