Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic