With the new Persistence API the entities should (but is not mandatory) to implement the Serializable interface. In that case, and since entities are POJOS, you can serialize them and send them through the network, but if you return a Entity in a session business method, of course it is detached from any persistent context and any changes done in that instance, wont take effect in the database. In other words, you are not returning the Entity, you return a POJO, just a Value Object.
If the caller of your business method is another session bean, in that case you should be more carefull because the transaction scope can be propagated and maybe if you return an entity, this could not be detached and any change made to it, may take effect in the database.
(Im just preparing for the SCBCD 5 ... Im not a JEE expert so please correct if Im wrong.)
Camilo Morales<br />SCJP 5, SCBCD 5
posted 13 years ago
Hey sammaiah, how are you?
As far this: "The answer is TRUE because the BEAN ITSELF must never be EPOSED."
Yeah ...It does even make sense cause of EJB "Object" itself. I got a little confused between Bean "Object" and "component Interface"..(Component interfaces can normally be sent to the clients...)
Ok, that's right!
SCJP | SCWCD | SCBCD | SCWSD 5 | SCEA (I) 1.4 | SCEA 5 | IBM SOA 669
Get me the mayor's office! I need to tell her about this tiny ad: