Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Information return form lock

 
Ray Cheeny
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I use the Object as the key and recordNum as the
value in the LockManager.
Now I wonder :
1. When the lock -1 has occured ,should any other
client which wants to get lock be waiting or be
informed something.
2. If I want to informed the client sth,how to do? Maybe throw a exception,right?

Thanks!!!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ray the general thought on this issue is that you can safely assume that only the server when shutting down will call lock(-1).
When the server is then shutdown, any client still "connected" will start getting IOExceptions or other networking related exception, which you should already be handling on the client side, and that will be your "Message" that will be shown to the client.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic