Sample Questions Best site for GRE, LSAT, SAT, GMAT, TOEFL, CCNA, CCSA and interview sample questions  

Technical Sample Questions : C |  C++ |  Oracle |  Java | Unix |  Operating Systems |  Data Structure

Java Sample Questions ›› EJB Java Sample Questions

Java Technical Sample Questions : EJB Sample Questions

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

    Answer: 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.

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

    Answer: 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.

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

    Answer: 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.

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

    Answer: There is no default transaction attribute for an EJB.Section 11.5 of EJB v1.1 spec says that the deployer must specify a value for the transaction attribute for those methods having container managed transaction.In WebLogic, the default transaction attribute for EJB is SUPPORTS.

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

    Answer: An entity bean represents persistent global data from the database; a session bean represents transient user-specific data that will die when the user disconnects (ends his session).Generally, the session beans implement business methods (e.g.Bank.transferFunds) that call entity beans (e.g.Account.deposit, Account.withdraw)

  6. Is there any default cache management system with Entity beans ? In other words whether a cache of the data in database will be maintained in EJB ?

    Answer: Caching data from a database inside the Application Server are what Entity EJB's are used for.The ejbLoad() and ejbStore() methods are used to synchronize the Entity Bean state with the persistent storage(database).Transactions also play an important role in this scenario.If data is removed from the database, via an external application - your Entity Bean can still be "alive" the EJB container.When the transaction commits, ejbStore() is called and the row will not be found, and the transaction rolled back.

  7. Why is ejbFindByPrimaryKey mandatory?

    Answer: An Entity Bean represents persistent data that is stored outside of the EJB Container/Server.The ejbFindByPrimaryKey is a method used to locate and load an Entity Bean into the container, similar to a SELECT statement in SQL.By making this method mandatory, the client programmer can be assured that if they have the primary key of the Entity Bean, then they can retrieve the bean without having to create a new bean each time - which would mean creating duplications of persistent data and break the integrity of EJB.

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

    Answer: With the EJBHome version of the remove, you are able to delete an entity bean without first instantiating it (you can provide a PrimaryKey object as a parameter to the remove method).The home version only works for entity beans.On the other hand, the Remote interface version works on an entity bean that you have already instantiated.In addition, the remote version also works on session beans (stateless and stateful) to inform the container of your loss of interest in this bean.

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

    Answer: EJBs can be clients of other EJBs.It just works.Use JNDI to locate the Home Interface of the other bean, then acquire an instance reference, and so forth.

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

    Answer: An EJB server is an application, usually a product such as BEA WebLogic, that provides (or should provide) for concurrent client connections and manages system resources such as threads, processes, memory, database connections, network connections, etc.An EJB container runs inside (or within) an EJB server, and provides deployed EJB beans with transaction and security management, etc.The EJB container insulates an EJB bean from the specifics of an underlying EJB server by providing a simple, standard API between the EJB bean and its container.A Connector provides the ability for any Enterprise Information System (EIS) to plug into any EJB server which supports the Connector architecture.

« Previous || Next »

EJB Sample Question Number : 1-10| 11-20| 21-30| 31-40| 41-50| 51-60| 61-70| 71-80| 81-89
Sample Test Questions
GRE Sample Questions
CAT Sample Questions
GMAT Sample Questions
TOEFL Sample Questions
ACT Sample Questions
SAT Sample Questions
LSAT Sample Questions
PSAT Sample Questions
MCAT Sample Questions
PMP Sample Questions
GED Sample Questions
ECDL Sample Questions
DMV Sample Questions
CCNA Sample Questions
MCSE Sample Questions
Network+ Sample Questions
A+ Sample Questions
Technical Sample Questions
WASL Sample Questions
CISA Sample Questions

Other Sample Questions
Sample Interview Questions
Sample Teacher Interview Questions
Sample Citizenship Questions
Accuplacer Sample Questions
Science Bowl sample Questions
Driving Test Sample Questions
Sample Survey Questions Sample Essay Questions
Sample Behavioral Interview Questions

Copyright © 2004-2013, Best BSQ. All Rights Reserved.