Java Stream Question and Answers

21. What is a container and its role in EJB?
 
  • In EJB, there are a lot of interactions between a bean and its server.
  • These interactions are managed by a container, which is responsible for presenting a uniform interface between the bean and the server.
  • The container is responsible for creating new instances of beans, making sure that they are stored properly by the server, and so on.
  • The container is more a concept than a physical construct.
 
Your Name Your Email-ID
Your Answer
22. What is the primary difference between RPC and RMI?
 
  • The primary difference between RPC and RMI is that RPC (Remote Procedure Call) is used for procedure-based applications, and RMI (Remote Method Invocation) is used for distributed object systems.
  • With RMI, methods can be invoked on a specific object identity, and a specific business entity.
  • In RPC, a client can call procedures on a specific type of application, but there is no concept of object identity. While RMI is object oriented, RPC is procedural.
 
Your Name Your Email-ID
Your Answer
23. What is a transaction?
 
  • A transaction is a unit of work or a set of tasks that are executed together.
  • Transactions are automatic; in other words, all the tasks in a transaction must be completed together to consider the transaction a success.
  • Transactions are managed automatically. A bean developer won't need to use any APIs to explicitly manage a bean's involvement in a transaction.
 
Your Name Your Email-ID
Your Answer
24. What is Instance swapping?
  If a client request is received and no bean instance is associated with the EJB object, an instance is retrieved from the pool and assigned to the EJB object. This is called instance swapping.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 6 of 10