Jump to: navigation, search

EclipseLink/UserGuide/JPA/Advanced JPA Development/Performance/Weaving/Disabling Weaving with Persistence Unit Properties

EclipseLink JPA

link="http://wiki.eclipse.org/EclipseLink"
EclipseLink
Website
Download
Community
Mailing ListForumsIRC
Bugzilla
Open
Help Wanted
Bug 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 false:
    • eclipselink.weaving – disables all weaving;
    • eclipselink.weaving.lazy – disables weaving for lazy loading (indirection);
    • 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.

    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.2.0 DRAFT
Other versions...