My Data class uses the Facade Pattern to provide the access to the file ( DatabaseAccess class ) and record locking facility ( LockManger class ).
When the server is started a single instance of the Data class ( and of DatabaseAccess & LockManager) is created to support database access to the many clients.
The DatabaseAccess class provides following methods :-
To ensure access to the database file is thread safe, I could synchronise all the above methods which would be easy and effective or I could introduce “ReadWriteLock” variables so that I could synchronise specific code blocks.
Any reason why I shouldn’t just synchronise all the methods in the DatabaseAccess class ?