Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] static weaving happening multiple times

Hello Tom,

Thanks, will try that tomorrow!

Yannick

Le 03-07-13 15:36, Tom Ware a écrit :
The code trail that determines which classes are used for each persistence unit starts in: org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(). The following line starts the process:

  // Process the Object/relational metadata from XML and annotations.
PersistenceUnitProcessor.processORMetadata(processor, throwExceptionOnFail, mode);

You should get into the above code once for each persistence unit.

In that method, we start by loading the mapping files. You can check to see that we're not finding any unexpected files.

After that, we get into this method:

org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.initPersistenceUnitClasses()

That method builds the list of classes we will eventually use for the persitence unit (and potentially weave).

-Tom

On 02/07/2013 10:59 AM, Yannick Majoros wrote:
Hi Tom,

No, we don't have any of this. As I work for a banking company with strict policies, I don't think they will allow me to send our model, but I'll ask.

How would you look at the problem? Where is the point in code where the decision is made to process all classes, or just those found in a persistence.xml or a
mapping file?

Best regards,

Yannick

Le 02-07-13 16:34, Tom Ware a écrit :
Hi Yannick,

I cannot reproduce this problem. Is there any chance you have one of the automatically-looked-up orm files on the classpath by accident and we are
finding those ones in all the persistence units?  (orm.xml or
eclipselink-orm.xml)

If you do not have either of those file, is it possible to provide a jar
that recreates the issue?

-Tom

On 02/07/2013 7:33 AM, MAJOROS Yannick wrote:
Hello,



I have a persistence.xml with 3 persistence units in it (see below).



I started to use static weaving with a maven plugin

(au.com.alderaan:eclipselink-staticweave-maven-plugin).



Now, it seems that weaving is occuring once per persistence unit, 3

times in total. I can see that from maven output:



Class [xxx] registered to be processed by weaver.



... occuring three times per class, in batches with some pause in

outputs in-between.



All of this using Eclipselink 2.3.2.



Also, in my next change, I'm going to use 2.5.0 and generate the

meta-model. With the same persistence.xml file, it tries to generate the

meta-model 3 times, although "exclude-unlisted-classes" is specified.



Should I fix something in my project or is this an Eclipselink bug?



persistence.xml:



<?xml version="1.0" encoding="UTF-8"?>

<persistence version="2.0"

        xmlns="http://java.sun.com/xml/ns/persistence";
<http://java.sun.com/xml/ns/persistence>

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
<http://www.w3.org/2001/XMLSchema-instance>

xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
<http://java.sun.com/xml/ns/persistencehttp:/java.sun.com/xml/ns/persistence/persistence_2_0.xsd>


http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd";
<http://java.sun.com/xml/ns/persistencehttp:/java.sun.com/xml/ns/persistence/persistence_2_0.xsd>>


        <persistence-unit name="abc">

<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

<jta-data-source>jdbc/abc</jta-data-source>

<mapping-file>META-INF/orm-abc.xml</mapping-file>

               <exclude-unlisted-classes />

<validation-mode>NONE</validation-mode>

               <properties>

<property name="eclipselink.weaving" value="static" />

                      <property name="eclipselink.logging.logger"

value="be.buyway.commons.util.CustomEclipseLinkLogger" />

<property name="eclipselink.logging.level" value="INFO" />

                      <property name="eclipselink.logging.level.sql"
value="FINE" />

                      <property name="eclipselink.logging.parameters"
value="true" />

-                     <property name="eclipselink.weaving.fetchgroups"
value="false" />

                      <property name="eclipselink.cache.coordination"
value="true" />

                      <property

name="eclipselink.cache.coordination.protocol"

                            value="jms" />

               </properties>

        </persistence-unit>

        <persistence-unit name="def">

<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

<jta-data-source>jdbc/def</jta-data-source>

               <exclude-unlisted-classes />

               <properties>

<property name="eclipselink.logging.level" value="FINE" />

               </properties>

        </persistence-unit>

        <persistence-unit name="ghi">

<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

<jta-data-source>jdbc/ghi</jta-data-source>

               <exclude-unlisted-classes />

               <properties>

<property name="eclipselink.logging.level" value="FINE" />

               </properties>

        </persistence-unit>

</persistence>



--

Yannick Majoros

cid:image001.png@01CE6E94.9C370630

This e-mail and any attachment(s) are strictly confidential and intended solely for the use of the addressee. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. Unauthorized publication, use, dissemination, forwarding, printing or copying of this e-mail and its associated attachments is strictly prohibited. The sender and its affiliates decline any liability if the mail is modified.


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top