My Oracle Support Banner

Em.Refresh() Issues An Update Statement When Issued In A Transaction (Doc ID 1448951.1)

Last updated on MARCH 16, 2021

Applies to:

Oracle TopLink - Version and later
Information in this document applies to any platform.


Loading an entity which has a @PreUpdate method to the cache and needing to
use the em.refresh() method on this entity.
When em.refresh()  method call is enclosed in a transaction, @PreUpdate is
triggered and update statement is fired to the database.

The em.refresh()  method is supposed to be a read-only operation that treats database as
source of truth and updates the cache. No update statement should be
generated and the @PreUpdate function should not be triggered.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.