[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quick question on threads & remote stubs



>On Sun, 01 Apr 2001, Reason wrote:
>> If two separate threads within the same JVM call
>> ExternalDatabase.objectForName(name), do they receive references to the
same
>> stub object or to two different stub objects? In other words, does each
>> different thread within a single JVM requesting an interface to the same
>> persistant object require the creation of a new stub?
>
>Yes, each subsequent call of objectForName, regardless if this is in the
same
>or a different thread, creates and returns a new proxy object. proxy
objects
>are very small (6 bytes) so this should not be a problem. An object cache
could
>help to reduce the number of proxy objects in the VM but this would also
add an
>extra overhead to search in the cache each time a proxy is created.

Ok...how about references? e.g. you make an objectForName call for
persistant object X that contains references to persistant objects Y and Z.
You then get object Y via the reference and start working with it. In this
case, do you get a new proxy object with every call in the same thread to
the X.method() that returns Y?

Reason
http://www.exratio.com/