• Post Reply Bookmark Topic Watch Topic
  • New Topic

NX: Data implementation - fully synchronized approach

 
Gytis Jakutonis
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
in my assignment I need to implement DBMain interface in Data class. I decided to have separate singleton DBAccess, which is used by Data-per-client instances.
While reading many posts I came to conclusion that concurency is a big issue and my DBAccess has to support concurent reads/writes etc. But after two weeks of analysis I see, that many DBAccess methods like find/create/isLocked need either to synchronize on all database or to use nested synchronized blocks. Other methods seems to support concurency, but they require synchronization on database file at some point. So is it worth to strive for concurency with such a cost(more code = more bugs = harder to understand). Currently I'm considering an option to make all DBAccess methods synchronized. How about this approach?
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!