Websphere 7 - BMP Entity Bean - ejbStore 在事务结束时调用,而不是在 setter 方法之后调用
我们正在从 Weblogic 迁移到 Websphere 7。它是一个遗留应用程序,包含 EJB 2.0 bean。实体 bean 具有 BMP。会话外观 bean 对实体 bean 进行更新,但更新会在事务结束时保留到数据库(调用实体 bean 的 ejbStore() 方法),这会导致问题,因为更新对于事务中的其他客户端不可见。在 Weblogic 中,有一个设置“delay-updates-until-end-of-tx”,可以设置为 false。这会导致更新被持久化,而无需等待事务结束。我读到 Websphere 的默认行为是不等待事务结束,但它似乎不是这样工作的。
我也尝试设置以下 JVM 参数:
-Dcom.ibm.ws.pm.deferredcreate=false -Dcom.ibm.ws.pm.batch=false
这也没有帮助。
对此的任何帮助将不胜感激。
谢谢, 迪克希特
We are migrating from Weblogic to Websphere 7. It is a legacy application and contains EJB 2.0 beans. The Entity beans have BMP. The session facade beans make updates to the entity beans but the updates are persisted to database (call to ejbStore() methods of entity beans) at the end of the transaction which causes problem as the updates are not visible to other client withing the transaction. In Weblogic there is a setting "delay-updates-until-end-of-tx" which can be set to false. This causes the updates to be persisted without waiting for the end of the transaction. I read that the default behavior of Websphere is to not wait for the end of the transaction but it does not seems to work like that.
I have tried setting the following JVM arguments as well:
-Dcom.ibm.ws.pm.deferredcreate=false
-Dcom.ibm.ws.pm.batch=false
This didn't help either.
Any help on this would be highly appreciated.
Thanks,
Dikshit
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CMP 有声明性选项,但我不认为 BMP 有选项。应该可以使用 EJBContextExtension.flushCache() WebSphere Application Server 扩展方法以编程方式强制容器存储/刷新所有未完成的实体:
http://publib.boulder.ibm.com/infocenter/wasinfo/fep/topic/com.ibm.websphere.javadoc.doc/web/apidocs/com/ibm/websphere/ejbcontainer/EJBContextExtension。 html
There are declarative options for CMP, but I don't believe there are options for BMPs. It should be possible to use EJBContextExtension.flushCache() WebSphere Application Server extension method to programmatically force the container to store/flush all outstanding entities:
http://publib.boulder.ibm.com/infocenter/wasinfo/fep/topic/com.ibm.websphere.javadoc.doc/web/apidocs/com/ibm/websphere/ejbcontainer/EJBContextExtension.html