Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.5
  Go To Table Of Contents
 Search
 PDFComments
Comments


persistence-context.flush-mode

Use eclipselink.persistence-context.flush-mode to configure the EntityManager FlushMode to be set as a persistence property and specify when flushing occurs.


Values

Table 5-78 describes this persistence property's values.

Table 5-78 Valid Values for persistence-context.flush-mode

Value Description

auto

(Default) Flushing occurs at query execution.

commit

Flushing occurs at transaction commit.



Usage

The property set in persistence.xml or passed to createEntityManagerFactory affects all EntityManagers created by the factory. To apply the property to specific EntityManagers pass it to createEntityManager method.


Examples

Example 5-77 shows how to use this property in the persistence.xml file.

Example 5-77 Using persistence-context.flush-mode in persistence.xml

<property name="eclipselink.persistence-context.flush-mode" value="commit" />


See Also

For more information, see: