Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "EclipseLink/UserGuide/JPA/Advanced JPA Development/Performance/Weaving/Disabling Weaving with Persistence Unit Properties"

m
m
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
----
 +
 +
 +
'''[[Image:Elug_draft_icon.png|Warning]] This page is now obsolete. '''
 +
 +
For current information, please see "Weaving" in the ''Java Persistence API (JPA) Extensions Reference for EclipseLink,'':
 +
http://www.eclipse.org/eclipselink/documentation/latest/jpa/extensions/persistenceproperties_ref.htm#CACGCEIJ2
 +
 +
 +
----
 +
 +
 
{{EclipseLink_UserGuide
 
{{EclipseLink_UserGuide
 
|info=y
 
|info=y
Line 6: Line 18:
  
 
=Disabling Weaving with Persistence Unit Properties=
 
=Disabling Weaving with Persistence Unit Properties=
To Disable weaving using EclipseLink persistence unit properties:
+
To disable weaving using EclipseLink persistence unit properties:
  
 
<ol>
 
<ol>
<li>Configure your <tt>persistence.xml</tt> file with one or more of the following properties set to <tt>false</tt><nowiki>:</nowiki>
+
<li>Configure your <tt>persistence.xml</tt> file with one or more of the following properties set to <tt>true</tt> or <tt>false</tt><nowiki>:</nowiki>
* <tt>eclipselink.weaving</tt> – disables all weaving;
+
* <tt>eclipselink.weaving</tt> – This can be used to disables all weaving.  This defaults to true if weaving is possible in the environment.
* <tt>eclipselink.weaving.lazy</tt> – disables weaving for lazy loading (indirection);
+
* <tt>eclipselink.weaving.lazy</tt> – This can be used to disables weaving for lazy loading (indirection).  This defaults to true.
* <tt>eclipselink.weaving.changetracking</tt> –  disables weaving for change tracking;
+
* <tt>eclipselink.weaving.changetracking</tt> –  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).
* <tt>eclipselink.weaving.fetchgroups</tt> – disables weaving for fetch groups.
+
* <tt>eclipselink.weaving.fetchgroups</tt> – This can be used to disables weaving for fetch groups.  This defaults to true.
* <tt>eclipselink.weaving.internal</tt> – disables weaving for internal optimization.  
+
* <tt>eclipselink.weaving.internal</tt> – This can be used to disables weaving for internal optimization.  This defaults to true.
* <tt>eclipselink.weaving.eager</tt> – disables weaving for indirection on eager relationships.<br><br>
+
* <tt>eclipselink.weaving.eager</tt> – 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.<br><br>
 
This example shows how to disable weaving for change tracking only.
 
This example shows how to disable weaving for change tracking only.
 
<br>
 
<br>
 
<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'''''  
<div class="pre">
+
<source lang="xml">
<persistence>
+
<persistence>
    <persistence-unit name="HumanResources">
+
  <persistence-unit name="HumanResources">
        <class>com.acme.Employee</class>
+
      <class>com.acme.Employee</class>
+
      ...
        ...
+
      <properties>
        <properties>
+
          <property name="eclipselink.weaving.changetracking" value="false"/>
            <property
+
      </properties>
                name="eclipselink.weaving.changetracking"
+
  </persistence-unit>
                value="false"
+
</persistence>
            />
+
</source>
        </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.
 
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 48:
 
<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'''''  
<div class="pre">
+
<source lang="xml">
<persistence>
+
persistence>
    <persistence-unit name="HumanResources">
+
  <persistence-unit name="HumanResources">
        <class>com.acme.Employee</class>
+
      <class>com.acme.Employee</class>
+
      ...
        ...
+
      <properties>
        <properties>
+
          <property name="eclipselink.weaving" value="false"/>
            <property
+
      </properties>
                name="eclipselink.weaving"
+
  </persistence-unit>
                value="false"
+
</persistence>
            />
+
</source>
        </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>
<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>Package and and deploy your application. .
 
</li>
 
</li>
 
</ol>
 
</ol>
 
  
  
Line 69: Line 71:
 
|next    =[[EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Performance/Fetch Groups|Fetch Groups]]
 
|next    =[[EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Performance/Fetch Groups|Fetch Groups]]
 
|up      =[[EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Performance/Weaving/About Weaving|About Weaving]]
 
|up      =[[EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Performance/Weaving/About Weaving|About Weaving]]
|version=2.2.0 DRAFT}}
+
|version=2.4 DRAFT}}

Latest revision as of 07:53, 17 April 2013



Warning This page is now obsolete.

For current information, please see "Weaving" in the Java Persistence API (JPA) Extensions Reference for EclipseLink,: http://www.eclipse.org/eclipselink/documentation/latest/jpa/extensions/persistenceproperties_ref.htm#CACGCEIJ2




EclipseLink JPA

Eclipselink-logo.gif
EclipseLink
Website
Download
Community
Mailing ListForumsIRCmattermost
Issues
OpenHelp WantedBug Day
Contribute
Browse Source


Disabling Weaving with Persistence Unit Properties

To disable weaving using EclipseLink persistence unit properties:

  1. 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.

    This example shows how to disable weaving for change tracking only.
    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>
  2. Package and and deploy your application. .


Eclipselink-logo.gif
Version: 2.4 DRAFT
Other versions...

Copyright © Eclipse Foundation, Inc. All Rights Reserved.