On Mon, 19 Feb 2001, Tom Cook wrote:
> 
> If I have two methods on an entity bean,
> 
> String getName()
> void setName( String name )
> 
> with fairly obvious meaning, then it is possible that a call to getName will
> return a reference to the cmp-field 'name', which is then modified by the
> servlet and persisted by the persistence manager without calling setName().

Tom, you're forgetting that Strings are immutable in java.
but in principle yes; that's what i'm on about.
say you've got a bean method taking xml DOM Nodes:

Node process(Node data);

now the bean might decide to manipulate 'data' to produce the result and
return it.
this client:

Node data = doc.createTextElement("da data");
Node result = bean.process(data);

with pass-by-ref there is no guarantee that 'data' will be a textnode with
the value 'da data' after the bean method invocation.
in fact this: if(data==result) might well be true, as can (data==null).

what i'm saying is that serializing all args and return values is a
limitation of RMI, but it also implies a certain behaviour. optimizing it
away might (will!) have unforeseen consequences.

on a sidenote -> reason i'm asking this is that i'm building an ejb-based
system with DOM infrastructure, but with our current ejb container _all_
bean calls are serialized (even bean-to-bean) which gives us deplorable
performance. imagine recursively serializing a large DOM tree every time
you call an ejbean, which in turn might call several dozen other beans!

/m



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to