can a session bean return a local entity bean object?

D

David Thielen

Hi;

If in a session bean (which is accessed remotely), can it return a
entity bean object (which is accessed locally) to the remote caller? I
know that changes to the entity bean object returned would not be
written to the database. But I just need a read/only copy of the data.

thanks - dave



Windward Reports -- http://www.WindwardReports.com
DefendTek -- http://www.DefendTek.com
Page 2 Stage -- http://www.Page2Stage.com
Enemy Nations -- http://www.EnemyNations.com
me -- http://dave.thielen.com
Barbie Science Fair -- http://www.BarbieScienceFair.info
Hillary Clinton -- http://www.HillaryIn2004.org
(yes I have lots of links)
 
B

Bryce (Work)

Hi;

If in a session bean (which is accessed remotely), can it return a
entity bean object (which is accessed locally) to the remote caller? I
know that changes to the entity bean object returned would not be
written to the database. But I just need a read/only copy of the data.

Use Value objects pattern.
http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html

Hides the implementation of your entity beans from the non-local
clients. Basically, just create a bean with the fields you need. I
usually have no setters, just getters.
 
M

Marek Lange

David said:
Hi;

If in a session bean (which is accessed remotely), can it return a
entity bean object (which is accessed locally) to the remote caller? I
know that changes to the entity bean object returned would not be
written to the database. But I just need a read/only copy of the data.

A local interface is designed for in-VM use only. You have to use an
object which is serializable for the transport to the caller (--> value
objects).

-marek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top