Sample Questions Best site for GRE, LSAT, SAT, GMAT, TOEFL, CCNA, CCSA and interview sample questions  

Technical Sample Questions : C |  C++ |  Oracle |  Java | Unix |  Operating Systems |  Data Structure

Java Sample Questions ›› EJB Java Sample Questions

Java Technical Sample Questions : EJB Sample Questions

  1. What are the different kinds of enterprise beans?

    Answer: Different kind of enterrise beans are:

    • Stateless session bean
    • Stateful session bean
    • Entity bean
    • Message-driven bean

  2. What is Session Bean?

    Answer: A session bean is a non-persistent object that implements some business logic running on the server.

  3. What is Entity Bean?

    Answer: The entity bean is used to represent data in the database.

  4. What are the callback methods in Entity beans?

    Answer: Callback methods allows the container to notify the bean of events inits life cycle.The callback methods are defined in the javax.ejb.EntityBean interface.

  5. Can Entity Beans have no create() methods?

    Answer: Yes.In some cases the data is inserted NOT using Java application.

  6. What is bean managed transaction?

    Answer: If a developer doesn't want a Container to manage transactions, it's possible to implement all database operations manually.

  7. What are transaction attributes?

    Answer: The transaction attribute specifies how the Container must manage transactions for a method when a client invokes the method via the enterprise bean's home.

  8. What are transaction isolation levels in EJB?

    Answer: The transaction isolation levels in EJB are:

    • Transaction_read_uncommitted
    • Transaction_read_committed
    • Transaction_repeatable_read

  9. How EJB Invocation happens?

    Answer: The steps for EJB Invocation are:

    • Retrieve Home Object reference from Naming Service via JNDI.
    • Return Home Object reference to the client.
    • Create me a new EJB Object through Home Object interface.
    • Create EJB Object from the Ejb Objects.
    • Return EJB Object reference to the client.
    • Invoke business method using EJB Object reference.
    • Delegate request to Bean (Enterprise Bean).

  10. Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?

    Answer: You can pass the HttpSession as parameter to an EJB method, only if all objects in session are serializable.This has to be consider as ?passed-by-value", that means that it?s read-only in the EJB.If anything is altered from inside the EJB, it won?t be reflected back to the HttpSession of the Servlet Container.The ?pass-by-reference? can be used between EJBs Remote Interfaces, as they are remote references.While it IS possible to pass an HttpSession as a parameter to an EJB object, it is considered to be ?bad practice ? in terms of object oriented design.This is because you are creating an unnecessary coupling between back-end objects (ejbs) and front-end objects (HttpSession).Create a higher-level of abstraction for your ejb?s api.Rather than passing the whole, fat, HttpSession (which carries with it a bunch of http semantics), create a class that acts as a value object (or structure) that holds all the data you need to pass back and forth between front-end/back-end.Consider the case where your ejb needs to support a non-http-based client.This higher level of abstraction will be flexible enough to support it.

« Previous || Next »

EJB Sample Question Number : 1-10| 11-20| 21-30| 31-40| 41-50| 51-60| 61-70| 71-80| 81-89
Sample Test Questions
GRE Sample Questions
CAT Sample Questions
GMAT Sample Questions
TOEFL Sample Questions
ACT Sample Questions
SAT Sample Questions
LSAT Sample Questions
PSAT Sample Questions
MCAT Sample Questions
PMP Sample Questions
GED Sample Questions
ECDL Sample Questions
DMV Sample Questions
CCNA Sample Questions
MCSE Sample Questions
Network+ Sample Questions
A+ Sample Questions
Technical Sample Questions
WASL Sample Questions
CISA Sample Questions

Other Sample Questions
Sample Interview Questions
Sample Teacher Interview Questions
Sample Citizenship Questions
Accuplacer Sample Questions
Science Bowl sample Questions
Driving Test Sample Questions
Sample Survey Questions Sample Essay Questions
Sample Behavioral Interview Questions

Copyright © 2004-2013, Best BSQ. All Rights Reserved.