Tolal:149 Click:
1
2 3 4 5 6 7 8
EJB Interview Questions And Answers
Page 1
Ques: 1
1. What is EJB?
Ans:
EJB technology is the server-side component architecture for the Java 2 Platform, Enterprise Edition (J2EE) platform. EJB technology enables rapid and simplified development of distributed, transactional, secure and portable applications based on Java technology
Ques: 2
what are Container-Managed Transactional attributes ?
Ques: 3 Entity bean is an abstract class and their local and home interface also extends an abstracts class.
Ques: 4 The EJB container implements the EJBHome and EJBObject classes. For every request from a unique client, does the container create a separate instance of the generated EJBHome and EJBObject classes?
Ques: 5 What is the advantage of putting an Entity Bean instance from the “Ready State” to “Pooled state”?
Ques: 6 Is it possible to share an HttpSession between a JSP and EJB?
Ans:
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.
Ques: 7 What happens when I change a value in the HttpSession from inside an EJB?
Ans:
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.
Ques: 8 Is there any way to read values from an entity bean without locking it for the rest of the transaction (e.g. read-only transactions)?
Ques: 9 Why we use this in the deployment descriptor? Explain with an example.
Ques: 10 ejb-jar.xml and weblogic-ejb-jar.xml explian it.
Ques: 11 Is the ejbCreate() method is compulsorry in stateless session beans, statefull session beans and entity beans?
Ques: 12 How to make a call to ejb a local instead of remote and what is the role of session facade in this procedure?
Ques: 13 What is the need of two Objects i.e EJBHome object and EJBobject to access a bean?
Ques: 14 Can I use session beans and hibernate (instead of entity beans) for persistence?
Ques: 15 How Non Java Client access EJB?
Ques: 16 How to invoke servlet from ejb components?
Ques: 17 Why can't you serialize the stub? Why do we need handles?
Ques: 18 Why can't you just use the equals() method instead of isIdentical()? isn't that what equals() is for?
Ques: 19 If something you’re passing to a remote method isn't Serilizable , is this a compile-time or runtime failure?
Ques: 20 When we are writing bean class in session beans, we are not implementing home interface and remote interface, then how can we provide the implementation for the methods in both the interfaces?
Goto Page:
1
2 3 4 5 6 7 8
EJB Objective
EJB Objective Questions And Answers
EJB Interview Questions And Answers
EJB Subjective Questions And Answers
R4R,EJB Objective, EJB Subjective, EJB Interview Questions And Answers,EJB,EJB Interview,EJB Questions ,EJB Answers