Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

locking within modify

 
Mario Zott
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am wondering why locking within the modify method of the Remote version of Data is necessary? modify implemented in Data is synchronized - so why use record locking in modify - BTW if we create a method bookFlights in our Controller we use lock read modify - unlock so technically we would lock 2 times (which is of course checked by the LockManager) ... what do you think?
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mario Zott:
i am wondering why locking within the modify method of the Remote version of Data is necessary?
Perhaps it isn't. What makes you think so?
- Peter
 
Mario Zott
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps it isn't. What makes you think so?

In my DataRemoteImpl the method isn't synchronized anymore, because each client has it's own copy, but i read some post's (maybe too much...) so it confused me a little bit...so i am on the right way when i do not implement lock/unlock in modify(DataInfo[])..
but what really drives me crazy is the Exception handling:
My DataClient (Interface) declares both DataExceptions and RemoteExceptions and the IOException thrown by lock (Interface is implemented by Data and DataRemote) so the client (in my case the FlightController) has to deal with both Exceptions - which i think is ok, because the controller doesn't know wether a Remote or Local Connection is used...) in the Controller i catch all Exceptions and rethrow some FlightControllerExceptions which i use in FBNMainWindow ... so should i use a logger in the Controller to specify some output for Remote- or DataBaseExceptions and use the FlightControllerException for userInfo (some Prompts) - what about Exception Chaining??? should i use that, and handle the complete Exceptions in the mainWindow - which i think is not good .. because the mainWindow (in fact the view) can change.... would be very nice, to give me some useful hints...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic