Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
So Max is Meharan Habibi? thanks
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
I can cut and paste the email here if you want?
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
Originally posted by morgan bath:
Thanks for the reply Max.
On point two ill give an example:
DVDAdapptor method returnRental() starts by locking the DVD using the DVDDatabase method reserveDVD() which synchronises on the resevedDVDs object.
It then calls the DVDDatabase method returnRental() which synchronises on 'this' (the DVDDatabase). Each DVDAdapter has its own DVDDatabase, and it seems to me that means only one thread will be using that particular method on that object. Plus seeing as you have locked the DVD in question even if two threads did use this method on the same object, one would not be able to run it until the other thread released the DVD lock.
It seems synchronising on 'this' in DVDDatabase is irrelavant, and only serves to increase overhead.
(Dear Oracle ill never bitch about your products again!)
[ January 28, 2004: Message edited by: morgan bath ]
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
Originally posted by morgan bath:
Thanks for the reply Max.
On point two ill give an example:
DVDAdapptor method returnRental() starts by locking the DVD using the DVDDatabase method reserveDVD() which synchronises on the resevedDVDs object.
It then calls the DVDDatabase method returnRental() which synchronises on 'this' (the DVDDatabase). Each DVDAdapter has its own DVDDatabase, and it seems to me that means only one thread will be using that particular method on that object. Plus seeing as you have locked the DVD in question even if two threads did use this method on the same object, one would not be able to run it until the other thread released the DVD lock.
It seems synchronising on 'this' in DVDDatabase is irrelavant, and only serves to increase overhead.
Originally posted by Max Habibi:
The issue here is that you want the client issuing a 'unlock' call to the same one that issued the 'lock' call. Per the RMI spec, it's not guaranteed that a given thread will interact with RMI in a predicable way. Thus, the DVD application chose to strictly define how that interaction would occur.
M
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
Originally posted by morgan bath:
To be honest I have a hard time understanding my own question when I re-read it
Im trying to understand the problem with RMI. I currently have the following:
GUI(MVC) connected via its controller to the RemoteAdapter. The RemoteAdapter has a LocalAdapter (similar to your DVDAdapter solution). The LocalAdapter connects to its own Data object. My Data Object uses a lockManager that stores the Data object so as to identify which client has the lock.
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
SCJP 1.4, SCJD, SCWCD 1.4
Morgan
SCJP (1.4), SCJD (1.4), SCWCD (1.3), SCBCD (1.3)
SCJP 1.4, SCJD, SCWCD 1.4
SJCP 1.4<br /> <br />"Go in there and do the best you can. That's all you can do."<br />Tiger Woods<br /> <br />"Practice is the best of all instructors."<br />Publilius Syrus (b. 42 AD)
SJCP 1.4<br /> <br />"Go in there and do the best you can. That's all you can do."<br />Tiger Woods<br /> <br />"Practice is the best of all instructors."<br />Publilius Syrus (b. 42 AD)
SCJP 1.4, SCBCD 1.3, SCWCD 5.0, SCJD B&S 2.3.1 (in progress)
Originally posted by Stephen Galbraith:
Hi Max,
My design relies on separate instances of the Data class being given per client. I now have my buisiness methods defined on the server .
Anyway, I have a remote connection factory which I bind using RMI. This returns the buisness logic class exposed via a buisness logic interface that "extends Remote". Hence I though I was keeping a reference to a particular instance of the Buiness logic (which resides on the server) at the client.
But reading this thread made me doubt it.
Is the issue the "binding" process, that can return any similar objects?
If you can clear this up for me I'll get your new book on regular expressions!
Thanks, Steve
Originally posted by Dixon Alexander:
Max,
would it be appropriate to post a message letting everyone else know of the price of the book at this moment?
SCJP 1.4, SCJD, SCWCD 1.4
Doe, a deer, a female deer. Ray, a pockeful of sun. Me, a name, I call my tiny ad ...
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|