• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to put Unique Client Identity in Lock / unlock method

 
Shailendra Guggali
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To ensure that the same client who locked the record is unlocking it, one has to maintain a unique client identity. in my structure where does one implement it???
The Client GUI is calling the methods searchFlight(String criteria) and bookFlight(Adapter object, DataInfo obj, String criteria). the bookFlight method is in a common class called Methods on the Client side or in Utilities. this method calls the Lock -- getRecord --- modify --- unlock ;;;;
the client ID is needed for the lock and unlock methods - It does not make sense putting the ID at the Client side as there is no way of checking whether it is duplicated as Clients are at different locations.
So the next choice is to put it at the server side -WHERE???
My server has a socket for listening - for each method call passed to the server a new processor thread is created which gets the Method and its parameters passed to it from Client and invokes the method on itself( finally creating a Data class object ).
in such a case where do I create the client ID and ensure that it is unique. how do i pass it to the method???
But still here I am not taking into account the loacal mode client?? how do I cater to both local and networked mode clients???
Thanx for your precious time
Shailendra
 
Shailendra Guggali
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to put the Client id creation in the Data Class and when the book flight method is called it first requests for a unique ClientID which is used for the lock and unlock method
working fine , but is it technically correct
shailendra
 
Matthew Comer
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out: http://www.javaranch.com/ubb/Forum25/HTML/001089.html
Matt
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic