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

(Doc ID 1448951.1)

Last updated on APRIL 27, 2012

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.


Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms