This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why is it not thread safety?

 
Chih-Wei Lee
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My assignment is B&S and it has cookie to lock and unlock record.
So I don't need the client id benefit from RMI Connection Factory.
I still try to use RMI Connection Factory because there is other benefit from it like only register once.
However, I choose to return the same DvdDatabase instance to client because
I can control the synchronization of record locking.

But according to Andrew's book,
If two remote invocations share the same DvdDatabase instance,
This can't ensure thread safety.

Why?

Thanks

Lee
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic