Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Could somebody suggest me about locking in standalone mode,please?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I saw a lot of discussions about whether or not to have locking mechanism in standalone mode but I am not really understand exactly how you guys do it. It is acceptable not to have any locking mechanism in standalone mode because we can assume that only one client accessing the database. I have the Data class that extends DBAccess interface as the instruction said. I am enjoyable working on locking mechanism for the network mode. But I still have no clue how to use the same Data class in standalone mode without using the lock/unlock method provided from the DBAccess interface since any other method requires a lockCookie as a parameter which can be obtained from the lock method. Did anyone reimplement the DBAccess interface and provide different Data access classes ( one for standalone mode and another for network mode? ). In my instruction(B&S 2.2.1) It stated "Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all.". I interpreted that we have to use the same Data class in both modes. Am I correct about this? I ever read someone mentioned about LockManager, how this relates to the locking implementaion in the standalone mode? Any help and suggestion about this would be highly appreciated. Thank you

Ken Kirin
SCJP
SWCD
SCJD(in progress)
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ken Kirin:
Hi All,

I saw a lot of discussions about whether or not to have locking mechanism in standalone mode but I am not really understand exactly how you guys do it. It is acceptable not to have any locking mechanism in standalone mode because we can assume that only one client accessing the database. I have the Data class that extends DBAccess interface as the instruction said. I am enjoyable working on locking mechanism for the network mode. But I still have no clue how to use the same Data class in standalone mode without using the lock/unlock method provided from the DBAccess interface since any other method requires a lockCookie as a parameter which can be obtained from the lock method. Did anyone reimplement the DBAccess interface and provide different Data access classes ( one for standalone mode and another for network mode? ). In my instruction(B&S 2.2.1) It stated "Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all.". I interpreted that we have to use the same Data class in both modes. Am I correct about this? I ever read someone mentioned about LockManager, how this relates to the locking implementaion in the standalone mode? Any help and suggestion about this would be highly appreciated. Thank you

Ken Kirin
SCJP
SWCD
SCJD(in progress)


Originally, I was going to not do locking in local mode, but that would require to overload every method that takes a cookie in the parameter list. I took the easy way out and did locking in local and documented my choice. Hope that helps.
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ken,

You do not have to care about locking issues in standalone mode, just use the same Data class that have locking for the standalone mode.

Regards,
Clivant
 
Ken Kirin
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am thinking of having locking mechanism in standalone mode as well. This would be easy and doesn't effect the performance hit much. If anybody would have any other good reason to do ( or not do ) so, please let me know. Thank you Daniel and Clivant

Ken Kirin
SCJP
SWCD
SCJD(B&S In progress)
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic