It's specified in the spec: see section "3.2.3 Synchronization to the Database":
[i]The persistence provider runtime is permitted to perform synchronization to the database at other times
as well when a transaction is active. The flush method can be used by the application to force synchronization.
It applies to entities associated with the persistence context. The EntityManager and
Query setFlushMode methods can be used to control synchronization semantics. The effect of
FlushModeType.AUTO is defined in section 3.6.2. If FlushModeType.COMMIT is specified,
flushing will occur at transaction commit; the persistence provider is permitted, but not required, to perform
to flush at other times.[/i]
Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]
http://forums.java.net/jive/thread.jspa?messageID=267176