English 中文(简体)
CMT中的持久性概念似乎不同于BMT中的持久性概念概念。
原标题:PersistenceContext in CMT seems to be different of PersistenceContext in BMT

I m currently having issues refreshing the data in my PersistenceContext. I have a CMT EJB3 bean which calls a BMT EJB3 bean. In the BMT bean, I do some process logic on an object. I commit the changes and I can see the changes in the database.

程序完成后, 我将返回到我的 CMT 豆。 我从 PersistenceContext (因为 BMT 豆改变了某些值) 中重新获取我的对象(. find () 方法), 但我仍然得到我对象的旧值 。 我甚至尝试了. refresh () 方法, 但数据没有更新 。

是否CMT和BMT豆类使用不同的持久性理论?

最佳回答

持久性环境通过进行中的交易传播,除了正常的持久性环境(例如不延长)之外,其L1缓存的寿命范围也扩大到同一交易。

所以,如果你在你的BMT豆中开始新的交易, 与其持久性环境互动,然后承诺, 那么所谓的 CMT豆在其持久性环境中将没有更新的值。

读取 DB 中的新值应该有效。 因此, 如果您看到 DB 中的这些变化, 特别是如果 CMT 和 BMT 豆子被在同一应用中( 因此没有 L2 不一致效果), 那么 < code> rerefresh < /code > 实际上应该有效 。

使用 CMT 豆子的新呼叫会怎么样? 它能看到更新的值吗?

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签