EJB Section Index | Page 25
How do I introspect a bean at run time to discover its type(s) and available methods?
Client applications or beans can access meta data about a bean from its EJBMetaData object. The EJBMetaData object is obtained from the bean's EJB home reference using the EJBHome.getEJBMetaData(...more
What makes a Java class an enterprise bean?
An enterprise bean is composed of many parts, not just a single class. Essentially, an enterprise bean is constructed with a bean class, remote interface, home interface and deployment descriptor...more
What is a container?
Enterprise beans are software components that run in a special environment called an EJB container. The container hosts and manages an enterprise bean in the same manner that a Java WebServer hos...more
How do I implement a logging system in my beans?
Using java.io is prohibited
Using the java.io package from within a bean is prohibited.
The EJB 1.1 Specification, section 18.1.2 (Programming Restrictions) states the following:
An enterpris...more
How do enterprise beans access native libraries?
In short, they don't.
The EJB 1.1 Specification, section 18.1.2 (Programming Restrictions) lists some things
that enterprise beans cannot do. In particular:
The enterprise bean must not attemp...more
What are all the different kinds of servers? (Such as Web Servers, Application Servers, etc)
The servers involved in handling and processing a user's request break down into a few basic types, each of which may have one or more tasks it solves. This flexibility gives developers a great d...more
How can my JSP page communicate with an EJB Session Bean?
The following is a code snippet that demonstrates how a JSP page can interact with an EJB session bean:
<%@ page import="javax.naming.*, javax.rmi.PortableRemoteObject,
foo.AccountHome, foo.Ac...more
Is entity data persisted at the end of a transaction or at any time?
Depends on what you mean by "persisted". Data that is part of a transaction like database rows are persisted depending on the success of the transaction. If the transaction manager dete...more
What are the constraints or drawbacks of container managed EJB's ?
CMP in beans depends a lot on the EJB vendor implementation and utilities.
With some implementations container-managed entity
beans can only by mapped to one table, while other implemenations of...more
How can I access my EJBs from COM environments such as VB?
Note: This question was answered by the vendor.
[One possible solution is J-Integra]
The J-Integra pure Java-COM bridge can be used to access EJBs running in any Application Server, in any JVM o...more
How do beans manage resource connections to back-end services other than databases ?
While EJB 1.1 provides the JNDI ENC for managing standard resources like URL, JDBC, JavaMail and JMS, connections to other types of resources are not addressed by EJB 1.0 or EJB 1.1, but there are...more
How do you configure a session bean for bean-managed transactions?
You must set transaction-type in the deployment descriptor.
How do you configure the transaction characteristics for a session bean with container-managed transactions?
You must set trans-attribute in the deployment descriptor.
How does an entity bean obtain a JTA UserTransaction object?
It doesn't. Entity beans do not employ JTA transactions; that is, entity beans always employ declarative, container-managed transaction demarcation. Entity beans, by definition, are somewhat tig...more
Is it possible for a stateless session bean to employ a JTA UserTransaction object?
Yes, but with restrictions. By definition, a stateless session bean has no state; hence, each method invocation must be independent. (The bean can be "swapped out" between method invoc...more