-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
If one person is writing rec 1 then till he does so no one will be able to write to any other record since he will have the lock for hte DBReader instance.
Are you synchronizing on the write method of DBFileHandler?
I do not know if the URLyBird assignment requires to have a decoupled lockRecord(recNo) ... (B&S assignment does..).
If you use a pool of DBFileHandler, what do you synchronize on to maintain data integrity?
#1 #2 #3
Your control flow is : DBManager => DBFileHandler => actual data
and you might be maintaining data integrity by controlling #1 AND #2 (Even singleton DBManager will be shared by multiple RMI threads concurrently).
Is it better to control the data integrity in one place, possible towards the end of the control flow?
Gist is, what would you gain by making DBManager singleton?
Thanks
-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
Synchronization now i have changed and created a separate Lock class that will hold the record number and the cookie. I synchronize on this lock object.
-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
created a separate Lock class that will hold the record number and the cookie. I synchronize on this lock object.
SCJP, SCJD, SCWCD, OCPJBCD
-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
Your mother was a hamster and your father was a tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
|