Discussions

EJB design: Virtual Data Entity Bean - a design issue

  1. Virtual Data Entity Bean - a design issue (3 messages)

    I've got a strange situation. For reasons not worth desribing, i need to create a "virtual data source" for an Entity Bean. I have no datastore available. EB1 retrieves a stream of data over a socket connection for a given user login (i can only connect once, and i get all data back). EB2 accesses and displays the data as the user requests it. EB1 and EB2 are each part of a complete j2ee module: jsp->javabean->stateless_session_bean->entity_bean. I need to "fudge" a data source for EB2 which "holds" the data from EB1.
    My thoughts ... create EJB3 with a Hashtable. EJB1 retrieves the stream of data over the socket related to a user login, parses it, and inserts it into the Hashtable in EJB3. EJB2 access EJB3 as its "datastore". On "pre-defined" time intervals, EJB3 removes "old" data entries in its own Hashtable.
    Comments please!?!
  2. What is your justification for using Entity Beans in this scenario? There may be a better solution that just uses Session Beans or doesn't use EJBs at all.

    Evan.
  3. Dear Evan,
      Ofcourse you can use EJB but pl do not use Entity in this case b'cause as you are mentioning the data will lost in the transactional phase as you are not storing it.
                    Rajeev
  4. Hi folks,

    I am facing a similar situation and would like to receive
    some feedback. I am trying to have a hashtable implemented
    using Stateful Session beans. What is the status of things
    on your side ? Have you found a solution for your problem ?

    thanks,

    Mario.