can a session bean return a local entity bean object?

Discussion in 'Java' started by David Thielen, Sep 10, 2003.

  1. 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)


    ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
     
    David Thielen, Sep 10, 2003
    #1
    1. Advertising

  2. David Thielen

    Bryce (Work) Guest

    On Wed, 10 Sep 2003 11:19:40 -0600, David Thielen <>
    wrote:

    >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.
     
    Bryce (Work), Sep 11, 2003
    #2
    1. Advertising

  3. David Thielen

    Marek Lange Guest

    David Thielen wrote:

    > 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
     
    Marek Lange, Sep 12, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. X3
    Replies:
    0
    Views:
    427
  2. Francesco
    Replies:
    3
    Views:
    495
  3. Samuel van Laere

    Entity Name or Entity Number?

    Samuel van Laere, Feb 24, 2007, in forum: HTML
    Replies:
    4
    Views:
    1,716
    Jukka K. Korpela
    Feb 24, 2007
  4. Replies:
    1
    Views:
    726
  5. markla
    Replies:
    1
    Views:
    572
    Steven Cheng
    Oct 6, 2008
Loading...

Share This Page