• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Record Loking (UrlyBird)

 
Mike Tilling
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you help please

I've used RMI as network mode

the locks methods are called within the methods implemented within the Data class (create, remove and book).

The method that books a record starts by bookLock() and end up with bookUnlock() and all the methods run on the server side, so if the same client tries to book the same record twice at the same time, on the server side there will be two different threads that will call {bookLock(), update(recNo) and bookUnlock}, and the record locking solution will be valid and the server does not need to know if the same client is trying to lock the record for the second time without releasing the record lock.

Please Advice
Mike
 
Kevin Conaway
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike,

Perhaps you should associate some kind of unique identifier with each client? This the clients can be identified independent of the whatever thread they might use.

Kevin
 
Mike Tilling
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kevin Conaway:
Mike,

Perhaps you should associate some kind of unique identifier with each client? This the clients can be identified independent of the whatever thread they might use.

Kevin
 
Mike Tilling
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kevin,

What I wanted to say is,

There is one RMI Server Object,
The client can invoke one of the following methods on the RMI Object

1-book (data) which books the selected record
2-remove (data) that deletes the specified record from the database file
3-create(data) which adds the specified record in the database file

each of these methods run on the server side, and (on the server side) they start by locking the record and end up with unlocking the record.

When the client invokes the create(data) method (for example), I wanted to confirm if there will be two different threads running on the server side.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic