Quantcast
Channel: zeroturnaround.com » All Posts
Viewing all articles
Browse latest Browse all 2540

Data not refreshed for a JPA entity with new property

$
0
0

Good Morning.

When I add a new property to an existing JPA entity JRebel reloads all the entities again (as it should) so I get the new property working on my code. So far so good.

But if I modify a value into the database then I don’t get the new value reflected on my entity when I execute a findById.

I expected that since all the persistence unit is reloaded I could get also the new values I introduced from MySQL Workbench.

I workarounded that by adding this to my persistence unit, forcing it to go straight to the database instead of hitting the cache:

<!– For JRebel purpose only, remove for production –>
<property name=”javax.persistence.cache.retrieveMode” value=”BYPASS”/>
<property name=”javax.persistence.cache.storeMode” value=”BYPASS”/>

The problem is that this code cannot run into our production system, and we are searching for a way so that JRebel deals with it without having to have those lines for development but not for production.

Do you have any suggest for this?
Thanks in advance.


Viewing all articles
Browse latest Browse all 2540

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>