EclipseLinkJpaVendorAdapter instead of HibernateJpaVendorAdapter issue

后端 未结 1 1108
广开言路
广开言路 2020-12-12 19:31

using an application which consist of JSF, Spring and Hibernate. My example runs normally, then when i changed the class=\"org.springframework.orm.jpa.vendor.HibernateJpaVen

1条回答
  •  离开以前
    2020-12-12 20:23

    By default, EclipseLink expects run-time weaving to be enabled, otherwise you will receive an error in the form 'Cannot apply class transformer without LoadTimeWeaver specified'. This means that for cases using build-time weaving or no weaving at all, you will need to explicitly indicate this behavior. In order to disable EclipseLink weaving you will need to either configure an application's EntityManagerFactory Spring bean with:

    
      
        
      
    
    

    or add the

    
    

    to your application's persistence.xml file.

    I recommend to activate the weaving since it's a great improve in performance.

    To configure the default run-time weaver expected by EclipseLink, add the following:

    
      
    
    

    to your application's EntityManagerFactory Spring bean.

    Then add this option to your JVM :

    -javaagent:/path-to-your-javaagent/org.springframework.instrument-3.1.1.RELEASE.jar
    

    In Spring 3.x the javaagent is localized in the org.springframework.instrument jar.

    You need the org.springframework.instrument library together with aspectjrt.jar and aspectjweaver.jar libraries.

    Reference

    • Optimizing JPA Performance

    0 讨论(0)
提交回复
热议问题