Session Bean Methods

Table 3.1 provides summary of session bean methods.

Table 3.1. Summary of Session Bean Methods
MethodPurposeWhat You Need to Do
setSessionContext (SessionContext)The EJB container calls this method to set the associated session context.You store the reference to the session context in an instance variable, if you need to query it later. The session context provides access to runtime session context such as identifying the caller, access or change current transaction state, and so on.
ejbCreate<method>(...)The container calls this method so that you can initialize your session bean instance. A client creates a stateful instance using the create methods defined in the session bean's home interface. The container calls the corresponding ...

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.