• Post Reply Bookmark Topic Watch Topic
  • New Topic

Synchronization in the update-Method.

 
Olena Golub
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have 3 tier architecture. Every client receives the own instance of the Data class through ConnectionFactory.
All locked records with locked cookies I saved in:


Inside the lock and unlock methods I synchronize lockedRecord.


But I am totaly lost about the update method. I will check the lockedRecords in this method, therefore I need also
to syncronize lockedRecords.
But what about RandomAccessFile raf?
Should I also synchronize it in the update method?
Or should I not synchronize the RandomAccessFile object at all to prevent from the dead-locks?
My write method is also not synchronized.

Could you help me?
Thanks a lot for your help!
Olena
 
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!