NX: Data implementation - fully synchronized approach
posted 12 years ago
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?