Showing posts with label ejb questions. Show all posts
Showing posts with label ejb questions. Show all posts

EJB Questions and answers

0 comments Posted by Unknown at 18:24

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


Technically yes, spec. compliant NO! - The enterprise bean must not attempt to query a class to obtain information about the declared members that are not otherwise accessible to the enterprise bean because of the security rules of the Java language.

Is it legal to have static initializer blocks in EJB? 


 Although technically it is legal, static initializer blocks are used to execute some piece of code before executing any constructor or method while instantiating a class. Static initializer blocks are also typically used to initialize static fields - which may be illegal in EJB if they are read/write - In EJB this can be achieved by including the code in either the ejbCreate(), setSessionContext() or setEntityContext() methods.


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


 Stopping the execution of a method inside a Session Bean is not possible without writing code inside the Session Bean. This is because you are not allowed to access Threads inside an EJB.
Read More »

EJB common interview Questions and Answers

0 comments Posted by Unknown at 18:21

What is EJB ? 


EJB is a standard for building server side components in JAVA. It specifies an agreement between components and application servers that enables any component to run in any application server. EJB components are deployable and can be imported in to an application server which hosts these components. EJB are not intended for client side they are server side components. They are specially meant for complex server side operations like executing complex algorithms or high volume business transactions.

Above is the most popular architecture in software industry. Three tier architecture has many advantages but the most important of them is that you can change any layer with least changes. For instance you can change the business logic with out making changes to UI or the database side. EJB provides the application layer logic. Application layer logic is also called as middle tier. EJB provides a standard specifications-based way to develop and deploy enterprise-class systems. It’s like moving towards an actually thought JAVA dream that we can run on any vendor platform. This is in contrast to the vendor-specific way we used to develop where each application server had its own way of doing things and where the developer was tied up to a application server. 
Read More »

Top 25 EJB solved Questions

0 comments Posted by Unknown at 16:35
1. What is EJB?
EJB stands for Enterprise JavaBeans and is widely-adopted server side component architecture for J2EE. It enables rapid development of ission-critical application that are versatile, reusable and portable across middleware while protecting IT investment and preventing vendor lock-in.

Read More »

LNT EJB 2012 solved questions

0 comments Posted by Unknown at 16:31
EJB Basic Questions
What is EJB?
http:\\capptitudebank.blogspot.in
EJB stands for Enterprise Java Beans and is widely-adopted server side component architecture for J2EE. It enables rapid development of critical application that are versatile, reusable and portable across middleware while protecting IT investment and preventing vendor lock-in. It contains the application's business logic and live business data.
 What are the different kinds of enterprise beans?
 Different kind of enterprise beans are:
Session bean- It is a non-persistent object that implements some business logic running on the server. They are of two types session bean stateless and stateful.
Entity bean-It is used to represent data in the database. It provides an object-oriented interface.
Message-driven bean- They are enterprise beans that receive and process JMS messages. It doesn’t even have any interface.  
Read More »

EJB solved questions For LNT

0 comments Posted by Unknown at 18:54
Why does EJB needs two interfaces(Home and Remote Interface)

There is a pure division of roles between the two .

Home Interface is the way to communicate with the container which is responsible for creating , locating and removing beans and Remote Interface is the link to the bean that allows acces to all methods and members.


What are the optional clauses in EJB QL?
WHERE and ORDERBY clauses are optional in EJB QL where as SELECT and FROM are required clauses.
Can I invoke Runtime.gc() in an EJB?
You shouldn’t. What will happen depends on the implementation, but the call will most likely be ignored.
Read More »

HCL EJB interview questions and Answers

0 comments Posted by Unknown at 18:29
Is it legal to have static initializer blocks in EJB? 

Although technically it is legal, static initializer blocks are used to execute some piece of code before executing any constructor or method while instantiating a class. Static initializer blocks are also typically used to initialize static fields - which may be illegal in EJB if they are read/write - In EJB this can be achieved by including the code in either the ejbCreate(), setSessionContext() or setEntityContext() methods. 


No, you cannot map more than one table to a single CMP Entity Bean. CMP has been, in fact, designed tomap a single table. 

Read More »

EJB Interview Questions

0 comments Posted by Unknown at 18:26

EJB Interview Questions and Answers
Q:
What are the different kinds of enterprise beans?
A:
Stateless session bean- An instance of these non-persistent EJBs provides a service without storing an interaction or conversation state between methods. Any instance can be used for any client.

Stateful session bean- An instance of these non-persistent EJBs maintains state across methods and transactions. Each instance is associated with a particular client.

Entity bean- An instance of these persistent EJBs represents an object view of the data, usually rows in a database. They have a primary key as a unique identifier. Entity bean persistence can be either container-managed or bean-managed. 

Message-driven bean- An instance of these EJBs is integrated with the Java Message Service (JMS) to provide the ability for message-driven beans to act as a standard JMS message consumer and perform asynchronous processing between the server and the JMS message producer.
Read More »

EJB Interview Questions

0 comments Posted by Unknown at 18:21
EJB Interview Questions

How EJB Invocation happens?



• 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 Object


• Return EJB Object reference to the client


• Invoke business method using EJB Object reference


• Delegate request to Bean (Enterprise Bean).




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?

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-byreference? can be used between EJBs Remote Interfaces, as they are remot references. 
Read More »
 

© 2011. All Rights Reserved | Interview Questions | Template by Blogger Widgets

Home | About | Top