javapandit.net
  • Home
  • Quick Java
    • Exception Handling
    • Collections Framework
  • Java Best Practices
  • Web Services
    • Web Service Basics
    • Ten Basic webservice concepts
    • XML
    • Apache Axis
    • Restful Web Services
  • JMS Concepts
    • JMS- MySQL
  • Hadoop
    • NoSQL DATABASEs
    • Apache Sqoop
    • Hadoop Interview Questions
  • Java 5
  • Java 8
    • Java 8 : Lambda Expressions
  • JDBC
  • Java Architect
    • Enterprise application re-platforming strategies
    • Java Memory Management
  • Java Programs
  • Technical Tips
    • How to set JAVA_HOME environment variable
    • How to create an auto increment field in Oracle?
    • Linux Commands
  • Best Java Interview Questions
    • Java Interview Questions- YouTube
  • Interview Questions
    • Java Tech interview Questions
    • Core Java Interview Questions >
      • core tech questions1
      • Java Collection interview questions
      • Java Concurrency
    • Servlets Interview Questions
    • JSP Interview Questions
    • Java Web Services Interview Questions
    • EJB Interview Questions
    • XML Interview Questions
    • JMS Interview Questions
  • Struts Interview Questions
    • Struts 2 Interview Questions
  • Java EE Architects Interview Questions
    • Java Architect Interview Questions
    • Top 10 reasons for Java Enterprise Application Performance Problems
    • Web Application Scalability Questions for IT Architect
  • JavaPandit's Blog
  • Web Services Interview Questions
  • Servlets And JSP
  • Oracle SOA Interview Questions
    • Open ESB /JBI
    • BPEL Language
  • Log4J
  • Ant
  • Maven
  • JMeter
  • JUnit
  • Apache POI Framework
  • ORCALE SERVICE BUS (OSB) Interview Questions
  • J2EE Patterns
    • Model-View-Controller (MVC)
    • Front Controller
    • DAO
    • Business Delegate
    • Session Facade
    • Service Locator
    • Transfer Object
    • Design Patterns >
      • Creational Patterns >
        • Singleton
      • Behavioural Patterns
      • Structural Patterns
    • Intercepting Filter
  • SQL Interview Questions/Lab
  • Best Wall Papers
    • Devotional Songs
  • Java Community
  • HIBERNATE
  • ORACLE CC&B
    • Oracle CC&B Interview Questions
  • Docker
  • Little Princess
    • Sai Tanvi Naming Ceremony Celebrations
    • Rice Feeding Ceremony
    • Sai Tanvi Gallery
  • APPSC Career Guidance
    • AP History
    • Indian Polity
    • Indian Economy
    • Science & Technology
    • Mental Ability and Reasoning
    • Disaster Management
    • Current Affairs and Events
    • General Sciences >
      • Biology
      • Physics
      • Chemistry
    • Previous Question Papers
  • About Us
  • Contact US
13.    What are life cycle methods of Session Bean?        
         public void setSessionContext(SessionContext ct)
         public void ejbActivate()
         public void ejbPassivate()
         public void ejbRemove()

14.   What are life cycle methods of Entity Bean?    
        public void setEntityContext(EntityContext ct)
        public void unSetEntityContext()
        public void ejbActivate()
        public void ejbPassivate()
        public void ejbRemove()
        public void ejbLoad()
        public void ejbStore()

15.   What is difference between a stateless and stateful Session Beans?
Stateless Session Beans are beans that don't maintain state across method calls. They are generally  intended to perform individual operations automatically. Any instance of stateless bean can be used by any client at any time.

Stateful Session Beans -maintain state within and between transactions. Each Stateful session bean is    
associated with a specific client. Containers can automatically save and retrieve a beans state in  the process of managing instance pools of stateful beans.

16.   How do Stateful Session beans maintain consistency across transaction updates?      
Stateful session beans maintain data consistency by updating their fields each time a transaction is committed. To keep informed of changes in transaction status, a stateful session bean implements the SessionSynchronization interface. The Container then calls methods of this interface as it initiates and completes transactions involving the bean.

17.    What are types in Entity Beans?
Entity Beans are mainly two types:
  • Bean Managed
  • Container Managed
18.    What is the difference between container-managed and bean-managed persistence?
In bean managed persistence, the bean is entirely responsible for storing and retrieving its instance data. The EntityBean interface provides methods for the container to notify an instance when it needs to store or retrieve its data.

In container managed persistence, entity bean data is automatically maintained by the container using a mechanism of its choosing.

19.   How is an Entity Bean created?An Entity Bean can be created in two ways: by direct action of the client in which a create method is called on the bean's home interface or some other action that adds data to the database that the bean type represents.

20.   How does a container manages access from multiple transactions on an Entity Bean?  
Container can acquire an exclusive lock on the instance's sate in the database and serializable access from multiple transactions to this instance.

21.    Does Enterprise JavaBeans allow alternatives to Container-Managed Transactions (CMT)?   
In addition to container-managed transactions, an Enterprise JavaBeans can participate in client-managed and bean-managed transactions.

22.    What is the need of Remote and Home interface. Why can’t it be in one?    
The main reason is because there is a clear division of roles and responsibilities between the two interfaces.  The home interface is your way to communicate with the container, that is who is responsible of creating, locating even removing one or more beans.

The remote interface is your link to the bean that will allow you to remotely access to all its methods and members. As you can see there are two distinct elements (the container and the beans) and you need two different interfaces for accessing to both of them.

23.   Can I develop an Entity Bean without implementing the create () method in the home interface?
As per the specifications, there can be 'ZERO' or 'MORE' create () methods defined in an Entity Bean. In cases where create() method is not provided, the only way to access the bean is by knowing its primary key, and by acquiring a handle to it by using its corresponding finder method. In those cases, you can create an instance of a bean based on the data present in the table. All one needs to know is the primary key of that table.

i.e., Set a columns that uniquely identify a single row in that table.Once this is known, one can use the
‘getPrimaryKey () ' to get a remote reference to that bean, which can further be used to invoke business methods.


Prev 1 2 3 4 5 Next
Powered by Create your own unique website with customizable templates.