<> Context – An EJB context has all the information that is common to both the entity bean and the session.
<> InitialContext – This is a constructor providing the initial context.
<> Session Context – This has the required information for a session bean that it will need from a container.
EJB has a mechanism called persistence. An EntityManager in EJB is a persistence interface that is used for performing operations like add, update, delete or find on a particular persistent entity. It is also used for executing queries through the Query interface.
Yes, it is allowed in cases where data is not inserted by using Java application.
No, more than one table cannot be mapped in a single CMP.
Home Object reference is retrieved from the Naming Service via JNDI. Home Object reference is returned to the client. The steps are:
> Created a new EJB Object via Home Object interface.
> Created an EJB Object from the Ejb Object.
> Returned an EJB Object reference to the client.
> Invoked business method by using EJB Object reference.
> Delegate requested to Bean (Enterprise Bean).
JavaDoc doclet, an open source is a doclet which generates good stuff related to EJB from comment tags of custom JavaDoc, which are embedded in the source file of EJB.
It is legal technically, but static initializer blocks have been used in executing pieces of code before the final execution of any method or constructor when a class is instantiated.
Enterprise JavaBeans can be accessed from Active Server Pages by:
<> ‘Java 2 Platform’
<> Enterprise Edition Client Access Services (J2EETM CAS) COM Bridge 1.0 which has been currently downloaded from the Sun Microsystems.
If the entity bean is defined as re-entrant, then it is possible by multiple clients to associate with the Entity bean and get methods executed concurrently inside the entity bean. Synchronization is taken care of by container. There is an exception thrown when an entity beam is defined as non-re-entrant and numerous clients are connected to it concurrently to carry out a method.
A persistent field is returned by the select method of an entity bean that is related. A remote or local interface is returned by the finder method.
Server group copies are defined as clone. But unlike Server Groups, clones are linked by means of nodes.
During runtime, when the changes made in the various properties of server group, are propagated in every associated clone, this process is known as Ripple Effect.
When the contents having the memory of a single physical m/c are simulated in all m/c in that cluster, that process is called memory replication.
When a task's interrupt() method is executed, the task enters the ready state. The next time the task enters the running state, an InterruptedException is thrown.
The non-Unicode letter characters $ and _ may appear as the first character of an identifier
By associating Checkbox objects with a CheckboxGroup.
A protected method may only be accessed by classes or interfaces of the same package or by subclasses of the class in which it is declared.
The finally clause of the try-catch-finally statement is always executed unless the thread of execution terminates or an exception occurs within the execution of the finally clause.
The technologies embraced in J2EE are:
Enterprise JavaBeansTM (EJBsTM)
JavaServer PagesTM (JSPsTM)
Java Servlets
The Java Naming and Directory InterfaceTM (JNDITM)
The Java Transaction API (JTA)
CORBA
The JDBCTM data access API.
The compiler supplies a default constructor for a class if no other constructors are provided.
The operating system's task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially.
The abs() method is used to calculate absolute values.
The File class is used to create objects that provide access to the files and directories of a local file system.
The paint() method supports painting via a Graphics object. The repaint() method is used to cause paint() to be invoked by the AWT painting thread.
The Collection interface provides support for the implementation of a mathematical bag - an unordered collection of objects that may contain duplicates.
Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java's layout managers aren't tied to absolute sizing and positioning, they are able to accommodate platform-specific differences among windowing systems.
An I/O filter is an object that reads from one stream and writes to another, usually altering the data in some way as it is passed from one stream to another.
The elements of a GridBad layout are of equal size and are laid out using the squares of a grid.
The == operator compares two objects to determine if they are the same object in memory. It is possible for two String objects to have the same value, but located indifferent areas of memory.
The act of redeployment, deployment and un-deployment in Web logic when the server is running in EJB is called Hot Deployment.
ACID is Atomicity, Consistency, Isolation and Durability.
1. Atomicity: Operations that are bundled together and projected a single unit of job.
2. Consistency: Guarantees that after a transaction has taken place, there will be consistency.
3. Isolation: Helps protect viewing of other simultaneous incomplete transaction results.
4. Durability: Ensures durability by keeping a transitional log by which the permanent data be recreated by again applying the steps involved.
The JDK 1.02 event model uses an event inheritance or bubbling approach. In this model, components are required to handle their own events. If they do not handle a particular event, the event is inherited by (or bubbled up to) the component's container. The container then either handles the event or it is bubbled up to its container and so on, until the highest-level container has been tried. In the event-delegation model, specific objects are designated as event handlers for GUI components. These objects implement event-listener interfaces. The event-delegation model is more efficient than the event-inheritance model because it eliminates the processing required to support the bubbling of unhandled events.
A method's throws clause must declare any checked exceptions that are not caught within the body of the method.
The Java runtime system generates RuntimeException and Error exceptions.
The ObjectInputStream class supports the reading of objects from input streams.
A field variable is a variable that is declared as a member of a class. A local variable is a variable that is declared local to a method.
Static variables are only ok if they are final. If they are not final, they will break the cluster. What that means is that if you cluster your application server (spread it across several machines) each part of the cluster will run in its own JVM.
Say a method on the EJB is invoked on cluster 1 (we will have two clusters – 1 and 2) that causes value of the static variable to be increased to 101. On the subsequent call to the same EJB from the same client, a cluster 2 may be invoked to handle the request. A value of the static variable in cluster 2 is still 100 because it was not increased yet and therefore your application ceases to be consistent. Therefore, static non-final variables are strongly discouraged in EJBs.
To have a consistent interface, so that there is no different interface that you need to implement for Stateful Session Bean and Stateless Session Bean.
Both Stateless and Stateful Session Bean implement javax.ejb.SessionBean and this would not be possible if stateless session bean is to remove ejbActivate and ejbPassivate from the interface.
The garbage collector invokes an object's finalize() method when it detects that the object has become unreachable.
This() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.
A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices. Only one item may be selected from a Choice. A List may be displayed in such a way that several List items are visible. A List supports the selection of one or more List items.
The elements of a GridBagLayout are organized according to a grid. However, the elements are of different sizes and may occupy more than one row or column of the grid. In addition, the rows and columns may have different sizes.
When data that did not existed before is inserted, it is read as phantom whereas when data that already existed is changed, un-repeatable occurs.
The interaction between the client and the bean is called conversational while where multi method conversations are not held with clients it is known as non-conversational interactions.
A component can handle its own events by implementing the required event-listener interface and adding itself as its own event listener.
The java.util.EventObject class is the highest-level class in the event-delegation class hierarchy.
During compilation, the values of each case of a switch statement must evaluate to a value that can be promoted to an int value.
JNDI context: provides a mechanism to lookup resources on the network.
Initial Context: it provides initial context to resources.
Session Context:it has all the information available which is required to session bean from the container.
EjbContext:it contain information which is required to both session and entity bean.
An EJB can be called within another EJB by using JNDI which can be used for locating the Home Interface and acquiring the instance.
Yes, remove () can be a Stateless Session bean because the life remains the same till the method is executed.