How to update a Hibernate entity when a column is updated externally

#1

I have 2 applications and one database. First application use hibernate, second jdbs. I am updating data in database with SQL request in second app. How can I update my entity in first app if him already persistent?

0 Likes

#2

If the entity is not stored in the second-level cache, you don’t need to do anything. The next time the entity is fetched, it will contain the new data.

0 Likes

#3

However if the entity stored in the second level cashe can I to do anything to update entity?

0 Likes

#4

Yes, you can evict it if you know the entity that has changed. You can know that using Debezium.

Check out this article on the Debezium blog for more details.

0 Likes