Java
Can an entity bean be a listener for JMS messages?
Nov 27th
No. Message driven beans should be used to consume JMS messages.
Can I map an entity bean to more than one table?
Nov 27th
In WLS 8.1 it is possible to map an entity bean to multiple tables, however, there are some restrictions. Namely, each table must contain the same primary key columns. The columns can have different names in different tables, but they must contain the same values. When a new bean is created a row will be inserted in each table, and when a bean is removed a row is removed from each table. The rows in each table are related via their primary key values. The rows mapped to a particular entity bean will always have the same primary key value. More >
What is the free pool?
Nov 27th
The free pool is a data structure the EJB container uses to cache anonymous instances of a given bean type. The free pool improves performance by reusing objects and skipping container callbacks when it can.
Why is there no polymorphic-type response from a create() or find() method?
Nov 27th
The EJB Specification prohibits this behavior, and the weblogic.appc compiler checks for this behavior and prohibits any polymorphic type of response from a create() or find() method. The reason the create() and find() methods are not polymorphic is similar to the reason constructors are not polymorphic in Java. The derived classes generally do not know or cannot initialize the base class properly.
Must EJBs be homogeneously deployed across a cluster? Why?
Nov 27th
Yes. In WebLogic Server 6.0 and later, EJBs must be homogeneously deployed across a cluster for the following reasons: ? To keep clustering EJBs simple ? To improve performance by avoiding cross-server calls. If EJBs are not deployed on all servers, cross-server calls are more likely. ? To ensure that every EJB is available locall.y ? To ensure that all classes are loaded in an undeployable way. Every server must have access to each EJB’s classes so that it can be bound into the local JNDI tree. If only a subset of the servers deploys the bean, the other servers More >
How should I set max-beans-in-free-pool for stateless beans?
Nov 27th
This is explained in “Pooling for Stateless Session EJBs” in Programming WebLogic Enterprise JavaBeans.
How should I set initial-beans-in-free-pool for stateless beans?
Nov 27th
This is explained in “Pooling for Stateless Session EJBs” in Programming WebLogic Enterprise JavaBeans.
When are stateless EJBs passivated?
Nov 27th
Stateless ejbs are never passivated. Since stateless ejbs do not have state, there is no need to passivate them. They are put back into the free pool after each method call so they will be available to service other requests.
Can I call remove() on a stateless session bean?
Nov 27th
Yes. Currently, calling remove() on a stateless session bean is a noop.
When are ejbCreate and ejbRemove called on stateless EJBs?
Nov 27th
When the stateless beans are created and removed by the EJB container. Note that this does not correspond to calls to create and remove on the stateless home. Depending on your initial-beans-in-free-pool setting, beans may be created by the container during deployment at which point they are placed in the free pool. Aside from during deployment, beans will only be created to service requests when all of the beans in the free pool are in use and themax-beans-in-free-pool limit has not been met. Stateless beans are removed by the EJB container during undeployment.
