Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/UserGuide/JPA/Advanced JPA Development/Performance/Weaving/Disabling Weaving with Persistence Unit Properties"
< EclipseLink | UserGuide | JPA | Advanced JPA Development | Performance | Weaving
(→Disabling Weaving with Persistence Unit Properties) |
(→Disabling Weaving with Persistence Unit Properties) |
||
Line 20: | Line 20: | ||
<span id="Example 19-41"></span> | <span id="Example 19-41"></span> | ||
''''' Disabling Weaving for Change Tracking in the persistence.xml File''''' | ''''' Disabling Weaving for Change Tracking in the persistence.xml File''''' | ||
− | < | + | <source lang="xml"> |
− | + | <persistence> | |
− | + | <persistence-unit name="HumanResources"> | |
− | + | <class>com.acme.Employee</class> | |
− | + | ... | |
− | + | <properties> | |
− | + | <property | |
− | + | name="eclipselink.weaving.changetracking" | |
− | + | value="false" | |
− | + | /> | |
− | + | </properties> | |
− | + | </persistence-unit> | |
− | + | </persistence> | |
− | + | </source> | |
− | </ | + | |
The following example shows how to disable all weaving: in this example, EclipseLink does not weave for lazy loading (indirection), change tracking, or internal optimization. | The following example shows how to disable all weaving: in this example, EclipseLink does not weave for lazy loading (indirection), change tracking, or internal optimization. | ||
Line 40: | Line 39: | ||
<span id="Example 19-42"></span> | <span id="Example 19-42"></span> | ||
''''' Disabling All Weaving in the persistence.xml File''''' | ''''' Disabling All Weaving in the persistence.xml File''''' | ||
− | < | + | <source lang="xml"> |
− | + | persistence> | |
− | + | <persistence-unit name="HumanResources"> | |
− | + | <class>com.acme.Employee</class> | |
− | + | ... | |
− | + | <properties> | |
− | + | <property | |
− | + | name="eclipselink.weaving" | |
− | + | value="false" | |
− | + | /> | |
− | + | </properties> | |
− | + | </persistence-unit> | |
− | + | </persistence> | |
− | + | </source> | |
− | </ | + | |
</li> | </li> | ||
Line 60: | Line 58: | ||
</li> | </li> | ||
</ol> | </ol> | ||
− | |||
Revision as of 11:54, 24 May 2012
EclipseLink JPA
EclipseLink | |
Website | |
Download | |
Community | |
Mailing List • Forums • IRC • mattermost | |
Issues | |
Open • Help Wanted • Bug Day | |
Contribute | |
Browse Source |
Disabling Weaving with Persistence Unit Properties
To disable weaving using EclipseLink persistence unit properties:
- Configure your persistence.xml file with one or more of the following properties set to true or false:
- eclipselink.weaving – This can be used to disables all weaving. This defaults to true if weaving is possible in the environment.
- eclipselink.weaving.lazy – This can be used to disables weaving for lazy loading (indirection). This defaults to true.
- eclipselink.weaving.changetracking – This can be used to disables weaving for change tracking. This defaults to true if change tracking is possible for the entity (the entity must have LAZY collection relationships, no mutable basic mappings, and no embeddable element collection mappings).
- eclipselink.weaving.fetchgroups – This can be used to disables weaving for fetch groups. This defaults to true.
- eclipselink.weaving.internal – This can be used to disables weaving for internal optimization. This defaults to true.
- eclipselink.weaving.eager – This can be used to enable weaving for indirection on eager relationships, this allows change tracking on eager collection relationships, and improves cache concurrency for eager object relationships. This defaults to false.
Disabling Weaving for Change Tracking in the persistence.xml File<persistence> <persistence-unit name="HumanResources"> <class>com.acme.Employee</class> ... <properties> <property name="eclipselink.weaving.changetracking" value="false" /> </properties> </persistence-unit> </persistence>
The following example shows how to disable all weaving: in this example, EclipseLink does not weave for lazy loading (indirection), change tracking, or internal optimization.
Disabling All Weaving in the persistence.xml File
persistence> <persistence-unit name="HumanResources"> <class>com.acme.Employee</class> ... <properties> <property name="eclipselink.weaving" value="false" /> </properties> </persistence-unit> </persistence>
- Package and and deploy your application. .