This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Why is it not thread safety? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Why is it not thread safety?" Watch "Why is it not thread safety?" New topic
Author

Why is it not thread safety?

Chih-Wei Lee
Ranch Hand

Joined: Feb 20, 2008
Posts: 129
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


SCEA, SCJD, SCDJWS, SCWCD, SCJP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why is it not thread safety?
 
Similar Threads
Design review and thread-safety
NX: Locking 101, and Max's book
Questions about DvdFileAccess (code from the book)
my lock mecanism NEED GREEN LIGHT
some questions aboute Dennys's DVDs