Ask the Expert

Is it possible to call entity bean in session bean? If so, how?

Is it possible to call entity bean in session bean? If so how do I call?

    Requires Free Membership to View

It is possible to call and entity bean from a session bean. In fact, that is generally what you need to do. You will want a session bean tier containing application logic which uses the entity beans for data access. Calling an entity bean from a session bean is pretty fundamental, so you will probably want to get a good book or do an EJB tutorial (http://java.sun.com/j2ee/tutorial/1_3-fcs/index.html). In short, a session bean is like any other client. You will want to do a JNDI look up on the EntityBean home and then call one of the create() or finder methods. Then you can call whatever methods on the EntityBean you need.

This was first published in January 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: