The Complete Project Source Code Platform

Kashipara.com is a community of ONE million programmers and students, Just like you, Helping each other.Join them. It only takes a minute: Sign Up

Job Resume Template

favorite enterprise java bean(ejb) Job Interview Questions And Answers


Why don't preparation your interviews. Best and top asking questions enterprise java bean(ejb) questions and answers. Prepare your job enterprise java bean(ejb) interview with us. Most frequently asked questions in enterprise java bean(ejb) interview. Top 10 most common enterprise java bean(ejb) interview questions and answer to ask. enterprise java bean(ejb) most popular interview question for fresher and experiences. We have good collection of enterprise java bean(ejb) job interview questions and answers. Ask interview questions and answers mnc company.employee ,fresher and student. enterprise java bean(ejb) technical questions asking in interview. Complete placement preparation for major companies tests and enterprise java bean(ejb) interviews,Aptitude questions and answers, technical, interview tips, practice tests, assessment tests and general knowledge questions and answers.


Free Download enterprise java bean(ejb) Questions And Answers Pdf.


favorite enterprise java bean(ejb) FAQ enterprise java bean(ejb) Interview Questions and Answers for Experiences and Freshers.



What do you mean by EJB?

Enterprise java bean is a server side component which runs on application server or we call container, developed for the purpose of distributed and enterprise level application .container will provide support for system level services like Transaction Management, security which make developer task easy and he can focus on business logic.

enterprise java bean(ejb)   jayvik 2014-04-03 08:04:09

What are the different types of EJB?

Mainly three types of EJB, 
 Entity Bean, 
 Session Bean and 
 Message Driven Bean(MDB).

Types of EJB:

Entity Bean: it represents an entity which is mapped with database or we can say it makes OR object Relational mapping with Database. Entity bean typically represent table in RDBMS and each instance represent row in the table.
 Two types of entity bean:

·          CMP Entity bean: Container managed entity bean its responsibility of container to manage the bean persistence behavior.

·          BMP Entity bean: Programmer manage the bean persistence behavior.

Session bean: Session bean is responsible for developing business logic it makes the client server relationship     so session beans exist till there is a session exist between client and server, it doesn’t contain persistent       business concept.
 Types of session bean

·          Stateless session bean: when there is not need to maintain state of a particular client stateless session bean is used .They alive for short period of time.
       For example if we are validating the credit card we can use stateless session bean.

·          Stateful session bean: stateful session bean maintain the conversational state of client over the series of method call before the bean instance goes to passive state conversational state is saved to persistence area like Hard disk and again when same client send a request and bean instance come into the active state it will come out from hard disk to main memory.
      For Example when we do online banking transaction ,online reservation we use stateful session bean

Message Driven Beans: these beans are work as a listener for messaging services like JMS .

enterprise java bean(ejb)   jayvik 2014-04-03 08:06:26

can we have static initializer Block in EJB.

Purpose of Static initializer block is to initialize some static fields before any execution of constructor or method or we can say creation of object. According to EJB Spec it’s a violation if static field are used and they are non final .

“EJB Spec”
Enterprise bean are not allowed to read or write the non final fields. 

But technically,from the point of java its correct but if in EJB we use static initializer block to initialize static field then because EJB components are used in distributed environment mean to say if  single JVM then it will be ok but if run on different JVM then it will be a problem if we change or update the value in on environment then only the instance running on same JVM have new value .that’s why static blocks are avoided and also all static field should be final.
And same thing we can achieve in ejbCreate(), setSessionContext() or setEntityContext() methods.

enterprise java bean(ejb)   jayvik 2014-04-03 08:09:31

Is threading is possible in EJB?

No, Not possible because EJBs are created and managed by container and if in ejbs we allow threading containers life cycle methods will be interrupted by us and also the purpose of EJB is to perform business logic not to controlling a system or implementation level functioning so container will manage the thread and developer can concentrate on business logic.

enterprise java bean(ejb)   jayvik 2014-04-03 08:11:10

what is Session facade?

Session Façade is one of the design pattern which is used in EJB component in this pattern session beans are used as a wrapper classes for entity bean and using session bean we interact with Entity bean .it will give clean approach towards client access to bean components and also reduce network calls so as to make the whole system of high performance.  

enterprise java bean(ejb)   jayvik 2014-04-03 08:12:25

Difference Between ejbStore() and ejbLoad()?

Both of these methods are used in context of entity bean for the purpose of synchronizing the instance variable to corresponding value store in the database. ejbLoad method load or refresh the instance variable from the database and ejbStore method writes variables value back to the database.

enterprise java bean(ejb)   jayvik 2014-04-03 08:13:26

What is the difference between JNDI context, Initial context, session context and ejb context.

JNDI context: provides mechanism to lookup resources on network.
 Initial Context: it provides initial context to resources.
Session Context:it has all the information available which is required to session bean     from container.
EjbContext:it contain information which is required to both session and entity bean.

enterprise java bean(ejb)   jayvik 2014-04-03 08:13:54

Explain the life cycle method of EJB?

Life Cycle of Entity Bean:

 First stage is Does Not Exist Stage t hen Container creates the instance of EJB and  call SetEntityContext() method  which will set all entity context to bean and now it will become available on pool ,to get a particular identity of an EJB object it has to move from Pooled stage to ready stage which is done by calling the create () method which in turns call ejbCreate() and ejbPostCreate() method .
There is another way by which directly entity bean can move to pooled stage to ready stage that’s is call ejbActivate() method.now we are ready to invoke the business method of entity bean .After completion of business method if we want to move again in pooled stage from ready stage we can call remove() method which in turns call ejbRemove() or directly call ejbPassivate () method.
At the end container remove the instance of EJBfrom pool and call unSetEntityContext().

Life Cycle of Stateful Session Bean :

Stateful session beans life cycle starts when  client call create() method.The container create the instance of session bean and call setSessionContext() and ejbCreate() method
Now the stateful session bean is ready to serve the client request after serving the request if it is not used after a long time container can move this bean to passive stage by calling the ejbPassivate() method.similarly when bean is in passive stage and client invoke the business method the container call ejbActivate() method to move bean from passive stage to active or ready stage.
At the end of life cycle client  call remove() method and container will call ejbRemove() method and bean is ready for garbage collection.

Life Cycle of Stateless session bean :

Stales session bean has short life cycle it can have two stage does not exist and ready stage. ejb container create the instance of stateless session bean and call setSessionContext () and ejbCreate() method.Now the bean is ready to invoke business method on this.it will not maintain the state so remove () method is been called after completion of business method which in turns  call ejbRemove () and now its ready for  garbage collection.
Life cycle of Message Driven bean:

MDBs have same life cycle like stateless session bean. setMessageDrivenContext() method and ejbCreate() method is called by container to create the instance of MDB.now its ready to receive message .and at the end of lifecycle client will call remove () method
which in turns  call ejbRemove () and now its ready for  garbage collection.

enterprise java bean(ejb)   jayvik 2014-04-03 08:08:31

What is connection pooling feature of EJB container?

Connection pooling is one of the Advance feature of container which enhanced our application performance .Using connection pooling mechanism client are not required to create every time connection object to interact with database .Here in pool objects are already available Whenever a client request for a database connection then an instance is picked from the connection pool to get an access to database and when user complete with his work instance is returned to connection pool. There is a limit specified by App server administrator for the availability of number of connections and beyond a specified limit a predefined number increases numbers of connection pool instances. When demand goes back to normal then access amount of connection pool instances are removed.

enterprise java bean(ejb)   jayvik 2014-04-03 08:11:55

What are the transaction Attribute ?


Transaction is group of operation or work which should be performed either completely or none to maintain the data integrity. All transaction must have ACID property(atomicity ,consistency,integrity,durability) so transaction can be said completed if we commit on successful execution and rollback on unsuccessful execution.
There are two ways of transaction management.
·          Declarative Transaction Mang.
·          Programmatic Transaction Mang.
Now we see what the transactions Attribute are
Transaction Attribute conveys to the container the intended transactional behavior of the associated EJB component's method.

Required: if required attribute is associated with Method then new Transaction context may or may not be created, means if method is already associated with transaction context then no new transaction context should be created.

Requires New: if Requires New attribute is associated with Method then always new Transaction context may be created.

NotSupported:if Method is Associated with this Attribute then method is  a not a part of transaction.

Supported:if a Method is Associated with this transaction Attribute then method will act as Not supported if calling component is not associated with transaction and if calling component is associated with transaction then act as a required Attribute.

Mandatory:if a method is Associated with this attribute then always be called from calling component transaction context.

Never: if a method is Associated with this attribute then never  be called from calling component transaction context.
The default transaction value for EJB is Support.

enterprise java bean(ejb)   jayvik 2014-04-03 08:12:58




favorite enterprise java bean(ejb) questions and answers for experienced


enterprise java bean(ejb) best Interview Questions have been designed especially to get you acquainted with the nature of questions you may encounter during your interview for the subject of enterprise java bean(ejb) Programming Language. here some questions that helpful for your interview. enterprise java bean(ejb) 2024 job interview questions with answers. enterprise java bean(ejb) for employee and fresher. Here we present some more challenging practice enterprise java bean(ejb) interview questions and answers that were asked in a real interview for a enterprise java bean(ejb) developer position. These questions are really good to not just test your enterprise java bean(ejb) skills, but also your general development knowledge. enterprise java bean(ejb) programming learning. we hope this enterprise java bean(ejb) interview questions and answers would be useful for quick glance before going for any enterprise java bean(ejb) job interview.