File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB" Watch "EJB" New topic


Hari Prasad M

Joined: Feb 27, 2006
Posts: 3
How to call an entity bean in the session with session facade design pattern ?

where we can write the database code ( which method)in session bean without entity bean ?

Hari Prasad Mallidi
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Hi Hari,
There is a "EJB and Other J2EE Technologies" forum here:

[My Blog]
All roads lead to JavaRanch
ak pillai
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
I would take it that you are using ejb 2.0 or earlier. you should perform a JNDI lookup of your entity bean from your session fascade layer. if your session beans and entity beans are within the same EJB container then you can use your entity beans as local otherwise remote. session fascade pattern minimises your network trips.

If you do no want to use entity beans then use other O-R mapping tools like Hibernate, iBatis, TopLink etc. You should write your database logic in a DAO layer( look at DAO pattern).

Session beans layer calls --> business manager layer calls --> DAO layer (can use Hibernate etc or pure JDBC) calls --> Database

java j2ee job interview questions with answers | Learn the core concepts and the key areas
I agree. Here's the link:
subject: EJB
It's not a secret anymore!