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 |
|---|---|
|
|
(Default) |
|
|
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: