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


persistence-context.persist-on-commit

Use eclipselink.persistence-context.persist-on-commit to specify if the EntityManager searches all managed objects and persists any related non-managed new objects that are cascade persist. This can be used to avoid the cost of performing this search if persist is always used for new objects.


Values

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

Table 5-79 Valid Values for persistence-context.persist-on-commit

Value Description

true

(Default)

false




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-78 shows how to use this property in the persistence.xml file.

Example 5-78 Using persistence-context.persist-on-commit in persistence.xml

<property name="eclipselink.persistence-context.persist-on-commit" value="false"/>


See Also

For more information, see: