Notice: This Wiki is now read only and edits are no longer 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
m |
m |
||
Line 6: | Line 6: | ||
=Disabling Weaving with Persistence Unit Properties= | =Disabling Weaving with Persistence Unit Properties= | ||
+ | To Disable weaving using EclipseLink persistence unit properties: | ||
+ | |||
+ | <ol> | ||
+ | <li>Configure your <tt>persistence.xml</tt> file with one or more of the following properties set to <tt>false</tt><nowiki>:</nowiki> | ||
+ | * <tt>eclipselink.weaving</tt> – disables all weaving; | ||
+ | * <tt>eclipselink.weaving.lazy – disables weaving for lazy loading (indirection); | ||
+ | * <tt>eclipselink.weaving.changetracking</tt> – disables weaving for change tracking; | ||
+ | * <tt>eclipselink.weaving.fetchgroups</tt> – disables weaving for fetch groups. | ||
+ | * <tt>eclipselink.weaving.internal</tt> – disables weaving for internal optimization. | ||
+ | * <tt>eclipselink.weaving.eager</tt> – disables weaving for indirection on eager relationships.<br><br> | ||
+ | This example shows how to disable weaving for change tracking only. | ||
+ | <br> | ||
+ | <span id="Example 19-41"></span> | ||
+ | ''''' Disabling Weaving for Change Tracking in the persistence.xml File''''' | ||
+ | <div class="pre"> | ||
+ | <persistence> | ||
+ | <persistence-unit name="HumanResources"> | ||
+ | <class>com.acme.Employee</class> | ||
+ | |||
+ | ... | ||
+ | <properties> | ||
+ | <property | ||
+ | name="eclipselink.weaving.changetracking" | ||
+ | value="false" | ||
+ | /> | ||
+ | </properties> | ||
+ | </persistence-unit> | ||
+ | </persistence> | ||
+ | </div> | ||
+ | |||
+ | 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. | ||
+ | |||
+ | <span id="Example 19-42"></span> | ||
+ | ''''' Disabling All Weaving in the persistence.xml File''''' | ||
+ | <div class="pre"> | ||
+ | <persistence> | ||
+ | <persistence-unit name="HumanResources"> | ||
+ | <class>com.acme.Employee</class> | ||
+ | |||
+ | ... | ||
+ | <properties> | ||
+ | <property | ||
+ | name="eclipselink.weaving" | ||
+ | value="false" | ||
+ | /> | ||
+ | </properties> | ||
+ | </persistence-unit> | ||
+ | </persistence> | ||
+ | </div> | ||
+ | |||
+ | For more information, see the [[#Table 19-16|EclipseLink JPA Persistence Unit Properties for Customization and Validation]] table. | ||
+ | </li> | ||
+ | <li>Package and and deploy your application. For more information, see [[Packaging%20and%20Deploying EclipseLink%20JPA%20Applications%20(ELUG)#Packaging and Deploying EclipseLink JPA Applications|Packaging and Deploying EclipseLink JPA Applications]]. | ||
+ | </li> | ||
+ | </ol> | ||
+ | |||
Revision as of 13:50, 9 May 2011
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 false:
- eclipselink.weaving – disables all weaving;
- eclipselink.weaving.lazy – disables weaving for lazy loading (indirection);
- <tt>eclipselink.weaving.changetracking – disables weaving for change tracking;
- eclipselink.weaving.fetchgroups – disables weaving for fetch groups.
- eclipselink.weaving.internal – disables weaving for internal optimization.
- eclipselink.weaving.eager – disables weaving for indirection on eager relationships.
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>
For more information, see the EclipseLink JPA Persistence Unit Properties for Customization and Validation table.
- Package and and deploy your application. For more information, see Packaging and Deploying EclipseLink JPA Applications.