- 实体EJB持久化建立的表为什么总是多出WLS_TEMP字段?
解答:To make iterative development easier, the WebLogic Server EJB container can be configured to automatically change the underlying table schema as entity beans change, ensuring that tables always reflect the most recent object relationship mapping.
Note: This feature is disabled when a server instance is running in production mode, as a production environment may require the use of more precise table schema definitions, for To ensure that the container only changes tables it created, container-created tables include an extra column, called wls_temp.
详细的请参考http://e-docs.bea.com/wls/docs81/ejb/entity.html 页面上的
Automatic Table Creation (Development Only)部分。
- 在MDB的ejbRemove方法中实现特殊功能的问题
问题描述:需要在服务器shutdown时(或application undeploy时)修改数据库,我在我的messgeDriven Bean的ejbRemove方法中调用数据库操作ejb修改数据库,前一段时间表现正常,可以修改,但今天发现不能修改,错误是:我调用的ejb对象已经不存在,已经被销毁。有没有办法控制ejb的销毁顺序,能让需要调用的ejb最后销毁
解答:做一个监听应用生命周期的类,可以参考BEA的白皮书《Developing Web Applications for WebLogic Server》。
- 单服务器的ejb写法和有cluster服务器ejb写法有何不同?
解答:没有区别,区别在于部署的时候不同,还要看如何布置集群,如果将整个应用放在同一个Server集群中,EJB是不能够被集群的。
- 解释一下有状态和无状态sessionbean的用法
解答:
有状态:一对一;
需要保存与特定可户有关的交谈状态;
一个Session Bean只对一个客户进行服务,因为它要保存为谁服务的信息,当有状态的Session Bean生成100个实例时,客户请求也只能一一对应来响应,实例不能错位;
无状态:一当多;
不维护任何特定于客户的交谈状态;
就象简单的Bean一样,不保存任何客户信息,即当一个无状态Session Bean在响应请求时生成100个实例的话,任何一个客户的请求用那100个实例中的任何一个实例进行响应即可,都是一样的。
- 在两个CMP之间建立了一个relationship(one to many ),想在删除主表的一条记录后自动删除附表的记录。但不能删除?
解答(by fengw):

注意有个<cascade-delete/>