get and set Attribute for EJB Context (Storing objects)

Discussion in 'Java' started by JehanNYNJ@aol.com, Dec 8, 2004.

  1. Guest

    Are there any methods like getAttribute and setAttribute off the EJB
    Context object like there is for Servlet context?

    Currently I did not see any in the API. How then are we supposed to
    store objects that we want to exist for the life of the app server and
    to be accesible by our beans?

    Thanks for any suggestions.
     
    , Dec 8, 2004
    #1
    1. Advertising

  2. wrote:

    > Are there any methods like getAttribute and setAttribute off the EJB
    > Context object like there is for Servlet context?


    Nope.

    > Currently I did not see any in the API. How then are we supposed to
    > store objects that we want to exist for the life of the app server and
    > to be accesible by our beans?


    Not at all. Such objects would not be compatible with the concept of EJBs,
    which includes clustering.

    You have to use entity beans for such purposes.
     
    Michael Borgwardt, Dec 8, 2004
    #2
    1. Advertising

  3. wrote:
    > Are there any methods like getAttribute and setAttribute off the EJB
    > Context object like there is for Servlet context?
    >
    > Currently I did not see any in the API. How then are we supposed to
    > store objects that we want to exist for the life of the app server and
    > to be accesible by our beans?
    >
    > Thanks for any suggestions.
    >


    Could you use JNDI to store and lookup the objects like you would a
    DataSource?
     
    Collin VanDyck, Dec 8, 2004
    #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. Steve
    Replies:
    1
    Views:
    705
    John C. Bollinger
    Jul 15, 2003
  2. Mumbai Joe
    Replies:
    0
    Views:
    611
    Mumbai Joe
    Jul 29, 2003
  3. Jeremy Haile

    To EJB or not to EJB

    Jeremy Haile, Sep 3, 2003, in forum: Java
    Replies:
    5
    Views:
    550
    Christopher Blunck
    Sep 10, 2003
  4. gk
    Replies:
    2
    Views:
    972
  5. Raymond Schanks
    Replies:
    0
    Views:
    671
    Raymond Schanks
    Aug 3, 2010
Loading...

Share This Page