热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

模拟考试

设为首页

收藏此页面

订阅邮箱地址

EJB 面试题与答案

Test your skills through the online practice test: EJB Quiz Online Practice Test

相关差异对比

相关差异对比

EJB 2.0 vs EJB 3.0EJB 3.0 vs SpringEJB 1.0 vs EJB 2.0
JavaBeans vs EJB

问题 66. What is EJB QL?

EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence. EJB QL is introduced in the EJB 2.0 specification. The EJB QL query language defines finder methods for entity beans with container managed persistenceand is portable across containers and persistence managers. EJB QL is used for queries of two types of finder methods: Finder methods that are defined in the home interface of an entity bean and which return entity objects. Select methods, which are not exposed to the client, but which are used by the Bean Provider to select persistent values that are maintained by the Persistence Manager or to select entity objects that are related to the entity bean on which the query is defined.

这有帮助吗? 添加评论 查看评论
 

问题 67. Can the primary key in the entity bean be a Java primitive type such as int?

The primary key cant be a primitive typeuse the primitive wrapper classes, instead. For example, you can use java.lang.Integer as the primary key class, but not int (it has to be a class, not a primitive).

这有帮助吗? 添加评论 查看评论
 

问题 68. How EJB Invocation happens?

Step 1: Retrieve Home Object reference from Naming Service via JNDI.
step 2: Return Home Object reference to the client.
step 3: Create me a new EJB Object through Home Object interface.
step 4: Create EJB Object from the Ejb Object
step 5: Return EJB Object reference to the client.
step 6: Invoke business method using EJB Object reference.
step 7: Delegate request to Bean (Enterprise Bean).

这有帮助吗? 添加评论 查看评论
 

问题 69. What are transaction attributes?

The transaction attribute specifies how the Container must manage transactions for a method when a client invokes the method via the enterprise beans home or component interface or when the method is invoked as the result of the arrival of a JMS message. (Suns EJB Specification) Below is a list of transactional attributes:

1. NotSupported - transaction context is unspecified.

2. Required - beans method invocation is made within a transactional context. If a client is not associated with a transaction, a new transaction is invoked automatically.

3. Supports - if a transactional context exists, a Container acts like the transaction attribute is Required, else - like NotSupported.

4. RequiresNew - a method is invoked in a new transaction context.

5. Mandatory - if a transactional context exists, a Container acts like the transaction attribute is Required, else it throws a javax.ejb.TransactionRequiredException.

6. Never - a method executes only if no transaction context is specified.

这有帮助吗? 添加评论 查看评论
 

问题 70. How can I call one EJB from inside of another EJB?

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.

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。