I think the sections 5.3 and 10.3.10 in the EJB2.0 final specification put
the responsibility on the bean provider as far as the modification of such
objects are concerned. An application server vendor creating a copy for a
local client is a different matter .

Hemant
----- Original Message -----
From: "Krishnan Subramanian" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 09, 2002 7:15 PM
Subject: Re: EntityBean problem


> 1.Differences in Remote and Local parameter passing - a.In a Remote
> call, changes made in the method body to the state of an object
> referenced by an argument to the method aren't visible to the client.
> b.In a local call, they are.

True, but not in the case of CMP 2.0 entity beans. For example, if you
have a persisted field of a java.sql.Timestamp type (say a "birthDate"
field) and if you have another EJB that calls the local component
interface of this entity bean (getBirthDate()) and then modifies the
state of that object (through the Timestamp.setTime(long)), then the
change does *not* get stored in the database.

Persisted fields can be modified only via the local entity bean's setters.

In fact the EJB 2.0 spec states that containers should make a copy of
any persisted field (that implements the java.io.Serializable interface)
before returning it to a (local) client. So, that pretty much implies
pass-by-value semantics for local calls (when the entity bean is the
callee).

-krish

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to