While using Hibernate ORM 5.x (with PostgreSQL DB) in one of our projects, we are facing a strange issue.
Data is added to a table in encrypted form and decrypted during extraction. Now when we try to add a new record with encrypted data in this table, the first row is also getting automatically updated and that too with the decrypted value which was being held in the L1 cache.
So any operation that was supposed to happen on the first record, fails since the value has changed from an encrypted one to decrypted one now,
What could possibly be going wrong here? Is there any way we can ensure that the previous row which had the decrypted value in L1 cache, does not get updated again in the database while inserting a new record?