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.
SOURCE : www.referjava.com
Friday, February 9, 2007
Two methods in a Primary Key class that should be implemented why?
The 2 methods are hashCode & equals.
These methods are required to compare the data of each row for uniqueness.
SOURCE : www.referjava.com
These methods are required to compare the data of each row for uniqueness.
SOURCE : www.referjava.com
How will use Where Clause in an CMP Bean ?
EJB2.0 introduced concept of EJB-QL to retrieve CMP beans. You can use WHERE clause in your EJB-QL and pass in parameters as part of findBy method parameters. Here is a sample ejb-ql which demonstrates a findBy method with EJB-QL having WHERE
clause.
hotelEJB
...
hotelSchemaName
...
...
findByCity
java.lang.String
hotelSchemaName AS h WHERE h.city = ?1]]>
...
...
SOURCE : www.referjava.com
clause.
...
...
hotelSchemaName AS h WHERE h.city = ?1]]>
...
...
SOURCE : www.referjava.com
What is the purpose of ejbRemove() in an Stateless Bean
To deallocate any resources. This method releases resources that were acquired within the ejbCreate and business methods.
SOURCE : www.referjava.com
SOURCE : www.referjava.com
What is Lazy Activation?
Lazy activation allows dynamic binding of object implementation into the registry. With lazy activation there is no need to bind the object with rmiregistry in the begining. When the server receives the first request from client it looks for the correct implementation and activates that object.
SOURCE : www.referjava.com
SOURCE : www.referjava.com
Is session bean a coarse grained bean?
YES, session beans are coarse grained bean. Entity beans are fine grained beans.
Actually it depends on how you use them. You can have design in which even Session beans can behave as fine grained beans. One eg. of coarse gained session... Instead of accessing entity beans directly, many a times we use session beans as a wrapper over a number of entity beans in the system. If a business functionality requires access to say 10 entity beans, that functionality can be encapsulated in a single session bean. Thus making it what we say coarse grained. In this case, entity beans can be said as fine grained.
A fine grained entity bean directly mapped to one relational table. A coarse grained entity bean is larger and more complex, either because its attributes include values or lists from other tables, or because it has more sets of dependent objects. The coarse grained bean might be mapped to a single table or flat file.
SOURCE : www.referjava.com
Actually it depends on how you use them. You can have design in which even Session beans can behave as fine grained beans. One eg. of coarse gained session... Instead of accessing entity beans directly, many a times we use session beans as a wrapper over a number of entity beans in the system. If a business functionality requires access to say 10 entity beans, that functionality can be encapsulated in a single session bean. Thus making it what we say coarse grained. In this case, entity beans can be said as fine grained.
A fine grained entity bean directly mapped to one relational table. A coarse grained entity bean is larger and more complex, either because its attributes include values or lists from other tables, or because it has more sets of dependent objects. The coarse grained bean might be mapped to a single table or flat file.
SOURCE : www.referjava.com
Subscribe to:
Posts (Atom)