setEntityContext and setSessionContext

Discussions

EJB design: setEntityContext and setSessionContext

  1. What is the actual use of

    setSessionContext()
    setEntityContext()
    unSetEntityContext()

    methods
  2. The SessionContext and EntityContext encapsulate the beans contract with the container.

    When the EJB is created these methods are called and the context is passed in for the bean to store if it wishes.

    From a pratical stand point the context allows you access to the users principle and role information, and the ability to set the rollback flag.

    David