• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

locking within modify

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
reply
    Bookmark Topic Watch Topic
  • New Topic