Entiy Question


EJB design: Entiy Question

  1. Entiy Question (1 messages)

    Hi all,

    I am developing an Entity EJB that will hold user session state data.
    Now there is one thing I am trying to get my brain around..
    All users will have different session states.
    I was thinking about creating a seperate Entity for each user, based on a Super class Entity EJB I have configured.
    However one of the main points of EJB spec. is sharing. Of course I do not want to share one users session data with another.
    When the session dies I want to either initialise or destory the Entity

    Question is:
    For each user session
    Can I create my user Entity from my super class Entity?
    Will I need to allocate a differnt JNDI name for each user Entity?
    Which is better to initialise or destory the Entity?

    thanks in advance,
    Should I watch out for any sharing/security issues?

    Threaded Messages (1)

  2. Entity Question[ Go to top ]

    Your design does not seem very viable... EJB provides a wonderful solution for session-time infromation - Session Stateful EJB. Now if you want to make this information persistent - that's where Entity Bean may be used. However there's no need to make this Entity EJB accessible to external users - only Session EJB will be able to communicate with it... And also - inheritance and EJB are a bad match...