Version automatically incrementing after entity read in Spring Boot JPA

I have requirement to export the data stored in Oracle database using spring boot application. We are using @Version for maintaining version. When we get the data using entity and export in excel file, versions are automatically incremented by 1.
As per my knowledge when we make any changes in persisted entity then it will increment the version and persist the data. But here we are getting data for read only purpose. Kindly help me trace the issue here.


Hibernate version : 5.3.10.Final
Spring Boot Version: 2…1.6


Logs while updating entity without having any changes apart from version:
2021-09-30 15:50:56.516 DEBUG 63898 — [http-nio-8080-exec-6] org.hibernate.SQL : update asset set last_updated_date=?, version_no=? where record_id=? and version_no=?
2021-09-30 15:50:56.516 TRACE 63898 — [http-nio-8080-exec-6] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [TIMESTAMP] - [2021-09-30T15:50:56.474]
2021-09-30 15:50:56.516 TRACE 63898 — [http-nio-8080-exec-6] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [BIGINT] - [8]
2021-09-30 15:50:56.516 TRACE 63898 — [http-nio-8080-exec-6] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [BIGINT] - [3478703]
2021-09-30 15:50:56.516 TRACE 63898 — [http-nio-8080-exec-6] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [BIGINT] - [7]

Maybe the timestamp changed in the meantime? Or you are facing some kind of precision mismatch? Note that java.util.Date is mutable, maybe you are changing the value?
Anyway, you could detach the entity right after reading to avoid this, or clear the persistence context with EntityManager.clear() before this read-only transaction finishes which will detach all entities.