JavaBeat FAQs
Sponsors
JAVABEAT
Home
Articles
Tips
QnA
Forums
FAQs Topics Books Topic
Java Java Books
Struts Struts Books
Spring Spring Books
Hibernate Hibernate Books
JBoss Seam Seam Books
J2EE J2EE Books
EJB EJB Books
JSF JSF Books
Servlets Servlets Books
JDBC JDBC Books
RMI RMI Books
JMS JMS Books
JNI JNI Books
Design Patterns Patterns Books
Exception Exception Books
Apache Ant Ant Books
Groovy
Cobertura
Quartz

EJB Interview Questions - 1

read more

1. What is EJB?

2. What is session Facade?

3. What is EJB role in J2EE?

4. What is the difference between EJB and Java beans?

5. What are the key features of the EJB technology?

6. What are the key benefits of the EJB technology?

7. How many enterprise beans?

8. What is message-driven bean?

9. What are Entity Bean and Session Bean?

10. How EJB Invocation happens?

11. 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?

12. 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?

13. Can the primary key in the entity bean be a Java primitive type such as int?

14. Can you control when passivation occurs?

15. What is the advantage of using Entity bean for database operations, over directly using JDBC API to do database operations? When would I use one over the other?

EJB Interview Questions - 3

read more

31. Why do we have a remove method in both EJBHome and EJBObject?

32. How can I call one EJB from inside of another EJB?=

33. What is the difference between a Server, a Container, and a Connector?

34. How is persistence implemented in enterprise beans?

35. What is an EJB Context?

36. Is method overloading allowed in EJB?

37. Are we allowed to change the transaction isolation property in middle of a transaction?

38. For Entity Beans, What happens to an instance field not mapped to any persistent storage, when the bean is passivated?

39. What is a Message Driven Bean, what functions does a message driven bean have and how do they work in collaboration with JMS?

40. Does RMI-IIOP support code downloading for Java objects sent by value across an IIOP connection in the same way as RMI does across a JRMP connection?

41. Does the container create a separate instance of the generated EJBHome and EJBObject classes?

42. What is the advantage of putting an Entity Bean instance from the Ready State to Pooled State?

43. What is the need of Remote and Home interface. Why can’t it be in one?

44. Can I develop an Entity Bean without implementing the create() method in the home interface?

45. Why an onMessage call in Message-driven bean is always a separate transaction?

EJB Interview Questions - 5

read more

1) What's different in Enterprise JavaBeans 1.1?

2)What is Enterprise JavaBeans?

3) What is an enterprise bean?

4) Are Enterprise JavaBeans and JavaBeans the same thing?

5) How does passivation work in stateful session beans?

6) How does a client application create a transaction object?

7) Do JTS implementations support nested transactions?

8) Why would a client application use JTA transactions?

9) How does a session bean obtain a JTA UserTransaction object?

10) Why would a session bean use bean-managed transactions?

EJB Interview Questions - 7

read more

21) What makes a Java class an enterprise bean?

22) While deploying CMP entity beans, which fields in the bean are container-managed and how are they identified?

23) Does the EJB programming model support inheritance?

24) How should complex find operations be implemented?

25) Can I use Threads in a enterprise bean?

26) Why are beans not allowed to create their own threads?

27) How does EJB support polymorphism?

28) What classes does a client application need to access EJB?

29) What is an EJB primary key? How is it implemented when the database doesn't have a primary key?

30) What's an .ear file?

EJB Interview Questions - 9

read more

41) When should I use bean-managed transactions instead of specifying transaction information in the deployment descriptor?

42) How do I automatically generate primary keys?

43) How is the passivation of Entity beans Managed?

44) To complete a transaction, which Transaction Attributes or Isolation Level should be used for a stateless session bean?

45) Explain the different Transaction Attributes and Isolation Levels with reference to a scenario.

46) What is the most efficient approach for integrating EJB with JSP? Should the EJBs be invoked directly from within JSP scriptlets? Should the access take place from within Java beans? Or is it best to use custom tags for this purpose?

47) How do you get a JDBC database registered with a JNDI name so that it can be accessed from an EJB?

48) How to manage fields that can have null values in a container-managed Entity bean?

49) How can I debug my EJB applications?

50) How can an applet talk directly with EJB?

EJB Interview Questions - 11

read more

61) Can the primary key in the entity bean be a Java primitive type such as int?

62) How do I map a Date/Time field to an Oracle database with CMP?

63) What is the difference between a Server, a Container, and a Connector?

64) What is "clustering" in EJB?

65) What is "hot deployment" in WebLogic?

66) Can I specify specific WHERE clauses for a find method in a CMP Entity Bean?

67) When using a stateful session bean with an idle timeout set, how can the bean receive notification from the container that it is being removed due to timeout?

68) I have created a remote reference to an EJB in FirstServlet. Can I put the reference in a servlet session and use that in SecondServlet?

69) What is the difference between a Component Transaction Monitor (CTM) and an Application Server?

70) How can I call one EJB from inside of another EJB?

EJB Interview Questions - 2

read more

16. What is EJB QL?

17. Brief description about local interfaces?

18. What are the special design cares that must be taken when you work with local interfaces?

19. What happens if remove( ) is never invoked on a session bean?

20. What is the difference between Message Driven Beans and Stateless Session beans?

22. How can I call one EJB from inside of another EJB?

23. What is an EJB Context?

24. Is it possible for an EJB client to marshal an object of class java.lang.Class to an EJB?

25. Is it legal to have static initializer blocks in EJB?

26. Is it possible to stop the execution of a method before completion in a SessionBean?

27. What is the default transaction attribute for an EJB?

28. What is the difference between session and entity beans? When should I use one or the other?

29. Is there any default cache management system with Entity beans?

30. Why is ejbFindByPrimaryKey mandatory?

EJB Interview Questions - 4

read more

46. Why are ejbActivate() and ejbPassivate() included for stateless session bean even though they are never required as it is a no conversational bean?

47. Static variables in EJB should not be relied upon as they may break in clusters. Why?

48. If I throw a custom ApplicationException from a business method in Entity bean which is participating in a transaction, would the transaction be rolled back by container?

49. Does Stateful Session bean support instance pooling?

50. Can I map more than one table in a CMP?

51. Can I invoke Runtime.gc() in an EJB?

52. Can a Session Bean be defined without ejbCreate() method?

53. How to implement an entity bean which the PrimaryKey is an auto numeric field?

54. When defining the Primary Key for the Enterprise Bean, the Deployer using the Container Provider's tools will typically add additional container-managed fields to the concrete subclass of the entity bean class.

55. What is clustering?

56. Is it possible to share an HttpSession between a JSP and EJB?

57. If my session bean with single method insert record into 2 entity beans, how can know that the process is done in same transaction (the attributes for these beans are Required)?

58. When should I adopt BMP and when I should use CMP?

EJB Interview Questions - 6

read more

11) How does an enterprise bean that uses container-managed transactions obtain a JTA UserTransaction object?

12) Is it possible for a stateless session bean to employ a JTA UserTransaction object?

13) How do you configure a session bean for bean-managed transactions?

14) How does an entity bean obtain a JTA UserTransaction object?

15) Is it necessary for an entity bean to protect itself against concurrent access from multiple transactions?

16) What are the constraints or drawbacks of container managed EJB's ?

17) Is entity data persisted at the end of a transaction or at any time?

18) How do enterprise beans access native libraries?

19) How do I implement a logging system in my beans?

20) What is a container?

EJB Interview Questions - 8

read more

31) Can beans use stored procedures in a database?

32) Is method overloading allowed in EJB?

33) How can JMS be used from EJB 1.1?

34) Can primary keys contain more than one field?

35) How does Container Managed Persistence work with automatically generated database

ID fields? Should I map the ID field explicitly or leave it unspecified?

36) Let's assume I use a JavaBean as a go-between a JSP and an EJB, and have, say, 50 concurrent clients that need to access the EJB functionality. Will the JSP container actually instantiate 50 instances of the bean, or can it reuse a single instance to access the EJB?

37) What happens when two users access an Entity Bean concurrently?

38) What's the reason for having two interfaces -- EJBHome for creating, finding & removing and EJBObject for implementing business methods. Why not have an single interface which supports both areas of functionality?

39) Which fields in beans should be public?

40) How do you implement callbacks in EJB?

EJB Interview Questions - 10

read more

51) What is the best way of implementing a web application that uses JSP, servlet and EJB technologies all together following a Model View Controller (MVC) architecture?

52) When does the container call my bean's ejbCreate / ejbPostCreate / ejbStore / ejbPassivate / ejbActivate / ejbLoad / ejbPassivate method? And what should I do inside it?

53) What's the difference between EJBHome, EJB Home, EJB Object, EJBObject and EJB (not to mention Home Interface and Remote Interface)?

54) Is there a difference between container managed and bean managed persistence in terms of performance?

55) Given that RMI-IIOP does not support distributed garbage collection (unlike RMI-JRMP), do I need to do something explicitly to GC beans, or is it magically handled by the EJB framework?

56) OK, so EJB doesn't support user-created threads. So how do I perform tasks asynchronously?

57) What is an EJB Context?

58) Can I deploy a new EJB without restarting my server? (I'm using Weblogic.)

59) How to setup access control in an EJB such that different application clients have different rights to invoke different methods in one EJB?

60) How is persistence implemented in enterprise beans?

EJB Interview Questions - 12

read more

71) When using Primary Keys, why do I have to implement the hashCode() and equals() method in my bean?

72) Can I deploy two beans in a single jar file? If so, how?

73) Why use EJB when we can do the same thing with servlets?

74) What restrictions are imposed on an EJB? That is, what can't an EJB do?

75) Why do we have a remove method in both EJBHome and EJBObject?

76) Why is it that business methods should not be declared final?

77) Why is ejbFindByPrimaryKey mandatory?

78) How can I pass init parameters to enterprise beans?

79) Should I use CMP or BMP for an application with complex data manipulation & relations?

80) For session beans, we can use the SessionSynchronization interface. For entity beans, how do we have control over a transaction?


Sponsors
Webmaster Hosting Forum
Java Jobs
Latest in DLinks
http://javawave.blogspot.com/2008/04/quartz-job-scheduler-part-ii-example.html
Quartz Job Scheduler -- Part 1 (Setting up development project in Netbeans 6.1 beta)
Flex Messaging with BEA Workshop Studio
SOA and Virtualization: How do They Fit Together?
Introduction to Enterprise Portals - Why they Benefit IT and the Business
BEA WebLogic Operations Control: Application Virtualization for Enterprise Java
Best Practices for Building Production Quality EAR Files
BEA's SOA Reference Architecture - A Foundation for Business Agility
Blueprint for Successful SOA Integration
Guardian - What a tool!

JavaBeat Media (2004-2008), India
javabeat home | About Us
our network : opensource softwares
Copyright © 2007 JavaBeat